diff --git a/frontend/src/plugins/link.ts b/frontend/src/plugins/link.ts index 00b91e2..3e98b90 100644 --- a/frontend/src/plugins/link.ts +++ b/frontend/src/plugins/link.ts @@ -140,12 +140,10 @@ export namespace LinkUtil { host: '', path: '', serviceName: '', - type: null, } switch (t.type){ case TrspTypes.HTTP: const th = t - params.type = 'http' params.host = th.host?.join(',')?? null params.path = th.path?? null break @@ -224,16 +222,16 @@ export namespace LinkUtil { v: 2, add: addr, aid: u?.alterId, - host: tParams.host, + host: tParams.host?? undefined, id: u?.uuid, - net: transport?.type?? 'tcp', + net: transport?.type == undefined || transport?.type == 'http' ? 'tcp' : transport.type, type: transport?.type == 'http' ? 'http' : undefined, - path: tParams.path, + path: tParams.path?? undefined, port: inbound.listen_port, ps: inbound.tag, - sni: inbound.tls.server_name?? '', + sni: inbound.tls.server_name?? undefined, tls: Object.keys(inbound.tls).length>0? 'tls' : 'none' } - return 'vmess://' + utf8ToBase64(JSON.stringify(params)) + return 'vmess://' + utf8ToBase64(JSON.stringify(params, null, 2)) } } \ No newline at end of file diff --git a/frontend/src/views/Inbounds.vue b/frontend/src/views/Inbounds.vue index 06824c4..1978d7a 100644 --- a/frontend/src/views/Inbounds.vue +++ b/frontend/src/views/Inbounds.vue @@ -203,7 +203,7 @@ const updateLinks = (i: InboundWithUser) => { i.users.forEach((u:any) => { const client = clients.value.find(c => u.username? c.name == u.username : c.name == u.name) if (client){ - const clientInbounds = inbounds.value.filter(i => client?.inbounds.split(',').includes(i.tag)) + const clientInbounds = inbounds.value.filter(inb => client?.inbounds.split(',').includes(inb.tag)) const newLinks = [] clientInbounds.forEach(i =>{ const uri = LinkUtil.linkGenerator(client.name,i)