From e2f2353da9b1d4f74c2cedb712d6e5c30ca79706 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Mon, 3 Feb 2025 20:07:16 +0100 Subject: [PATCH] Revert "fix getSubGroupClients for enable/disable and edit clients." --- web/html/xui/inbounds.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 0471f5a7..89a37a29 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -1108,6 +1108,36 @@ this.submit(`/panel/inbound/${dbInboundId}/delClient/${clientId}`); } }, + getSubGroupClients(dbInbounds, currentClient) { + const response = { + inbounds: [], + clients: [], + editIds: [] + } + if (dbInbounds && dbInbounds.length > 0 && currentClient) { + dbInbounds.forEach((dbInboundItem) => { + const dbInbound = new DBInbound(dbInboundItem); + if (dbInbound) { + const inbound = dbInbound.toInbound(); + if (inbound) { + const clients = inbound.clients; + if (clients.length > 0) { + clients.forEach((client) => { + if (client['subId'] === currentClient['subId']) { + client['inboundId'] = dbInboundItem.id + client['clientId'] = this.getClientId(dbInbound.protocol, client) + response.inbounds.push(dbInboundItem.id) + response.clients.push(client) + response.editIds.push(client['clientId']) + } + }) + } + } + } + }) + } + return response; + }, getClientId(protocol, client) { switch (protocol) { case Protocols.TROJAN: return client.password;