diff --git a/web/assets/js/model/inbound.js b/web/assets/js/model/inbound.js index 2a5fb6d6..5228001c 100644 --- a/web/assets/js/model/inbound.js +++ b/web/assets/js/model/inbound.js @@ -2150,7 +2150,7 @@ Inbound.TrojanSettings.Fallback = class extends XrayCommonClass { Inbound.ShadowsocksSettings = class extends Inbound.Settings { constructor(protocol, method = SSMethods.BLAKE3_AES_256_GCM, - password = RandomUtil.randomShadowsocksPassword(), + password = '', network = 'tcp,udp', shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()], ivCheck = false, @@ -2188,7 +2188,7 @@ Inbound.ShadowsocksSettings = class extends Inbound.Settings { Inbound.ShadowsocksSettings.Shadowsocks = class extends XrayCommonClass { constructor( method = '', - password = RandomUtil.randomShadowsocksPassword(), + password = '', email = RandomUtil.randomLowerAndNum(8), limitIp = 0, totalGB = 0, diff --git a/web/assets/js/util/index.js b/web/assets/js/util/index.js index 0d869af6..4bf760d7 100644 --- a/web/assets/js/util/index.js +++ b/web/assets/js/util/index.js @@ -138,8 +138,14 @@ class RandomUtil { } } - static randomShadowsocksPassword() { - const array = new Uint8Array(32); + static randomShadowsocksPassword(method = SSMethods.BLAKE3_AES_256_GCM) { + let length = 32; + + if ([SSMethods.BLAKE3_AES_128_GCM].includes(method)) { + length = 16; + } + + const array = new Uint8Array(length); window.crypto.getRandomValues(array); @@ -789,6 +795,25 @@ class LanguageManager { if (window.navigator) { lang = window.navigator.language || window.navigator.userLanguage; + const simularLangs = [ + ["ar", this.supportedLanguages[0].value], + ["fa", this.supportedLanguages[2].value], + ["ja", this.supportedLanguages[5].value], + ["ru", this.supportedLanguages[6].value], + ["vi", this.supportedLanguages[7].value], + ["es", this.supportedLanguages[8].value], + ["id", this.supportedLanguages[9].value], + ["uk", this.supportedLanguages[10].value], + ["tr", this.supportedLanguages[11].value], + ["pt", this.supportedLanguages[12].value], + ] + + simularLangs.forEach((pair) => { + if (lang === pair[0]) { + lang = pair[1]; + } + }); + if (LanguageManager.isSupportLanguage(lang)) { CookieManager.setCookie("lang", lang, 150); } else { diff --git a/web/html/common/head.html b/web/html/common/head.html deleted file mode 100644 index 35901769..00000000 --- a/web/html/common/head.html +++ /dev/null @@ -1,31 +0,0 @@ -{{define "head"}} - - - - - - - - - {{ .host }} – {{ i18n .title}} - -
-{{end}} \ No newline at end of file diff --git a/web/html/common/js.html b/web/html/common/js.html deleted file mode 100644 index 1c2d64b3..00000000 --- a/web/html/common/js.html +++ /dev/null @@ -1,14 +0,0 @@ -{{define "js"}} - - - - - - - - - -{{end}} \ No newline at end of file diff --git a/web/html/common/page.html b/web/html/common/page.html new file mode 100644 index 00000000..f1c58fe1 --- /dev/null +++ b/web/html/common/page.html @@ -0,0 +1,58 @@ +{{ define "page/head_start" }} + + + + + + + + + + + {{ .host }} – {{ i18n .title}} +{{ end }} + +{{ define "page/head_end" }} + +{{ end }} + +{{ define "page/body_start" }} + +
+{{ end }} + +{{ define "page/body_scripts" }} + + + + + + + + + +{{ end }} + +{{ define "page/body_end" }} + + +{{ end }} \ No newline at end of file diff --git a/web/html/component/aClientTable.html b/web/html/component/aClientTable.html index 868112d9..96bd502f 100644 --- a/web/html/component/aClientTable.html +++ b/web/html/component/aClientTable.html @@ -41,14 +41,28 @@ {{ i18n "password" }} - + diff --git a/web/html/form/protocol/shadowsocks.html b/web/html/form/protocol/shadowsocks.html index b9813afb..06e12075 100644 --- a/web/html/form/protocol/shadowsocks.html +++ b/web/html/form/protocol/shadowsocks.html @@ -31,7 +31,7 @@ Password + Password diff --git a/web/html/inbounds.html b/web/html/inbounds.html index 29e6b00f..e1267190 100644 --- a/web/html/inbounds.html +++ b/web/html/inbounds.html @@ -1,6 +1,4 @@ - - -{{template "head" .}} +{{ template "page/head_start" .}} +{{ template "page/head_end" .}} - +{{ template "page/body_start" .}} - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - {{ i18n "none" }} - {{ i18n "disabled" }} - {{ i18n "depleted" }} - {{ i18n "depletingSoon" }} - {{ i18n "online" }} - -
- -