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 +++- web/html/xui/form/client.html | 3 +- web/html/xui/form/protocol/shadowsocks.html | 83 ++++++++++++++++++++++++++++- web/html/xui/form/protocol/trojan.html | 6 +++ web/html/xui/form/protocol/vless.html | 6 +++ web/html/xui/form/protocol/vmess.html | 6 +++ web/html/xui/inbound_modal.html | 1 + web/html/xui/inbounds.html | 30 ++++++----- 8 files changed, 131 insertions(+), 15 deletions(-) (limited to 'web/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; } }, diff --git a/web/html/xui/form/client.html b/web/html/xui/form/client.html index 501861db..1740e74b 100644 --- a/web/html/xui/form/client.html +++ b/web/html/xui/form/client.html @@ -18,7 +18,8 @@ - + + diff --git a/web/html/xui/form/protocol/shadowsocks.html b/web/html/xui/form/protocol/shadowsocks.html index 718ba894..3c63fe01 100644 --- a/web/html/xui/form/protocol/shadowsocks.html +++ b/web/html/xui/form/protocol/shadowsocks.html @@ -1,5 +1,87 @@ {{define "form/shadowsocks"}} + + + + + {{ i18n "pages.inbounds.Email" }} + + + + + + + + + + + + + + + + + + + + {{ i18n "pages.inbounds.IPLimit" }} + + + + + + + + + + {{ i18n "pages.inbounds.totalFlow" }} (GB) + + + + + + + + + + + + + + + + {{ i18n "pages.inbounds.expireDate" }} + + + + + + + + + + + + + + + + + + +
[[ col ]]
[[ col ]]
+
+
[[ method ]] @@ -15,5 +97,4 @@ UDP -
{{end}} \ No newline at end of file diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index e63943e6..1581b07c 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -53,6 +53,12 @@
+ + + + + + {{ i18n "pages.inbounds.expireDate" }} diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html index 33e0c170..023c04b9 100644 --- a/web/html/xui/form/protocol/vless.html +++ b/web/html/xui/form/protocol/vless.html @@ -59,6 +59,12 @@ + + + + + + {{ i18n "pages.inbounds.expireDate" }} diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html index 6471e20d..62b80468 100644 --- a/web/html/xui/form/protocol/vmess.html +++ b/web/html/xui/form/protocol/vmess.html @@ -50,6 +50,12 @@ + + + + + + {{ i18n "pages.inbounds.expireDate" }} diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index 966de8dd..7c338e26 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -48,6 +48,7 @@ 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; } }, diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 2792eb75..5d7e041f 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -116,15 +116,11 @@ {{ i18n "pages.inbounds.operate" }} - - - {{ i18n "qrCode" }} - {{ i18n "edit" }} -