From f22dd6b53d736556377080a305c40be2db3c8cce Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 6 May 2023 20:21:14 +0330 Subject: [feature] multi-user shadowsocks @alireza0 Co-Authored-By: Alireza Ahmadi --- web/html/xui/client_modal.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'web/html/xui/client_modal.html') diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index bf4ed92a..e459b520 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -44,7 +44,7 @@ if (this.clients[index].expiryTime < 0){ this.delayedStart = true; } - this.oldClientId = this.dbInbound.protocol == "trojan" ? this.clients[index].password : this.clients[index].id; + this.oldClientId = this.getClientId(dbInbound.protocol,clients[index]); } else { this.addClient(this.inbound.protocol, this.clients); } @@ -56,14 +56,23 @@ case Protocols.VMESS: return clientSettings.vmesses; case Protocols.VLESS: return clientSettings.vlesses; case Protocols.TROJAN: return clientSettings.trojans; + case Protocols.SHADOWSOCKS: return clientSettings.shadowsockses; default: return null; } }, + getClientId(protocol, client) { + switch(protocol){ + case Protocols.TROJAN: return client.password; + case Protocols.SHADOWSOCKS: return client.email; + default: return client.id; + } + }, addClient(protocol, clients) { switch (protocol) { case Protocols.VMESS: return clients.push(new Inbound.VmessSettings.Vmess()); case Protocols.VLESS: return clients.push(new Inbound.VLESSSettings.VLESS()); case Protocols.TROJAN: return clients.push(new Inbound.TrojanSettings.Trojan()); + case Protocols.SHADOWSOCKS: return clients.push(new Inbound.ShadowsocksSettings.Shadowsocks()); default: return null; } }, -- cgit v1.2.3