From c2e9ee36658a8549251df7fb37467baa55341a5f Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 18 Jul 2023 03:19:01 +0330 Subject: update - shadowsocks Co-Authored-By: Alireza Ahmadi --- web/html/common/qrcode_modal.html | 2 +- web/html/xui/form/protocol/shadowsocks.html | 4 +++- web/html/xui/inbound_info_modal.html | 15 ++++++++++++++- web/html/xui/inbound_modal.html | 23 +++++++++++------------ web/html/xui/inbounds.html | 15 +++++++++++---- 5 files changed, 40 insertions(+), 19 deletions(-) (limited to 'web/html') diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 8edfa2de..12dd2060 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -37,7 +37,7 @@ this.inbound = dbInbound.toInbound(); settings = JSON.parse(this.inbound.settings); this.client = settings.clients[clientIndex]; - remark = this.dbInbound.remark + "-" + this.client.email; + remark = this.dbInbound.remark + ( this.client ? "-" + this.client.email : ''); address = this.dbInbound.address; this.subId = ''; this.qrcodes = []; diff --git a/web/html/xui/form/protocol/shadowsocks.html b/web/html/xui/form/protocol/shadowsocks.html index 7af96373..8e16b143 100644 --- a/web/html/xui/form/protocol/shadowsocks.html +++ b/web/html/xui/form/protocol/shadowsocks.html @@ -1,5 +1,6 @@ {{define "form/shadowsocks"}} + - + [[ method ]] diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index 00cb5ce6..fae058ad 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -179,6 +179,19 @@ [[ inbound.settings.network ]] + @@ -251,7 +264,7 @@ this.clientSettings = this.settings.clients ? Object.values(this.settings.clients)[index] : null; this.isExpired = this.inbound.isExpiry(index); this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : []; - remark = this.dbInbound.remark + "-" + this.clientSettings.email; + remark = this.dbInbound.remark + ( this.clientSettings ? "-" + this.clientSettings.email : ''); address = this.dbInbound.address; this.links = []; if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) { diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index 60244be4..65988b14 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -54,23 +54,11 @@ }, }; - const protocols = { - VMESS: Protocols.VMESS, - VLESS: Protocols.VLESS, - TROJAN: Protocols.TROJAN, - SHADOWSOCKS: Protocols.SHADOWSOCKS, - DOKODEMO: Protocols.DOKODEMO, - SOCKS: Protocols.SOCKS, - HTTP: Protocols.HTTP, - }; - new Vue({ delimiters: ['[[', ']]'], el: '#inbound-modal', data: { inModal: inModal, - Protocols: protocols, - SSMethods: SSMethods, delayedStart: false, get inbound() { return inModal.inbound; @@ -117,6 +105,17 @@ }); } }, + SSMethodChange() { + if (this.inModal.inbound.isSSMultiUser) { + if (this.inModal.inbound.settings.shadowsockses.length ==0){ + this.inModal.inbound.settings.shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()]; + } + } else { + if (this.inModal.inbound.settings.shadowsockses.length > 0){ + this.inModal.inbound.settings.shadowsockses = []; + } + } + }, setDefaultCertData(index) { inModal.inbound.stream.tls.certs[index].certFile = app.defaultCert; inModal.inbound.stream.tls.certs[index].keyFile = app.defaultKey; diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 193c080b..39c64aff 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -131,7 +131,11 @@ {{ i18n "edit" }} -
{{ i18n "pages.inbounds.targetAddress" }}