From d05707625118df7c208d45c0af466d709cfcd396 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Mon, 10 Jun 2024 17:19:32 +0200 Subject: [PATCH] fix client inbounds #154 --- frontend/src/views/Clients.vue | 4 ---- frontend/src/views/Inbounds.vue | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/Clients.vue b/frontend/src/views/Clients.vue index f147ddb..81a3e7e 100644 --- a/frontend/src/views/Clients.vue +++ b/frontend/src/views/Clients.vue @@ -193,10 +193,6 @@ const saveModal = (data:any, stats:boolean) => { if(modal.value.index == -1) { clients.value.push(data) } else { - const oldData = createClient(clients.value[modal.value.index]) - oldData.inbounds.forEach((i:string) => { - if (!data.inbounds.includes(i)) data.inbounds.push(i) - }) clients.value[modal.value.index] = data } diff --git a/frontend/src/views/Inbounds.vue b/frontend/src/views/Inbounds.vue index 7c16fa1..6cf8105 100644 --- a/frontend/src/views/Inbounds.vue +++ b/frontend/src/views/Inbounds.vue @@ -218,7 +218,7 @@ const saveModal = (data:Inbound, stats: boolean, tls_id: number) => { } modal.value.visible = false } -const updateLinks = (i: InboundWithUser) => { +const updateLinks = (i: any) => { if(i.users && i.users.length>0){ i.users.forEach((u:any) => { const client = clients.value.find(c => u.username? c.name == u.username : c.name == u.name) @@ -249,7 +249,7 @@ const delInbound = (index: number) => { const inbU = inb if (inbU.users && inbU.users.length>0){ inbU.users.forEach((u:any) => { - const c_index = clients.value.findIndex(c => u.username? u.username == c.name : u.user == c.name) + const c_index = clients.value.findIndex(c => u.username? u.username == c.name : u.name == c.name) if (c_index != -1) { const clientInbounds = clients.value[c_index].inbounds.filter((x:string) => x!=tag) clients.value[c_index].inbounds = clientInbounds @@ -277,7 +277,7 @@ const delInbound = (index: number) => { } delOverlay.value[index] = false } -const buildInboundsUsers = (inbound:InboundWithUser):Inbound => { +const buildInboundsUsers = (inbound:any):Inbound => { const users = [] const inboundClients = clients.value.filter(c => c.enable && c.inbounds.includes(inbound.tag)) inboundClients.forEach(c => {