From 6d28c39ae845cb0ac6e35562aaa52d8219b95bc8 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sun, 12 Feb 2023 17:20:09 +0330 Subject: [PATCH] en lang edit, new designed --- .gitignore | 3 +- config/version | 2 +- web/assets/js/model/models.js | 4 +- web/assets/js/model/xray.js | 21 ++-- web/assets/js/util/common.js | 14 ++- web/html/common/qrcode_modal.html | 72 +------------ web/html/xui/form/protocol/trojan.html | 20 ++-- web/html/xui/form/protocol/vless.html | 18 ++-- web/html/xui/form/protocol/vmess.html | 6 +- web/html/xui/form/sniffing.html | 2 +- web/html/xui/form/stream/stream_grpc.html | 2 +- web/html/xui/form/stream/stream_http.html | 2 +- web/html/xui/form/stream/stream_kcp.html | 14 +-- web/html/xui/form/stream/stream_tcp.html | 12 +-- web/html/xui/form/stream/stream_ws.html | 2 +- web/html/xui/form/tls_settings.html | 12 +-- web/html/xui/inbound_info_modal.html | 118 +++++++++++++++++----- web/html/xui/inbounds.html | 116 +++++++++++++++------ web/html/xui/inbounds_client_row.html | 18 +++- web/translation/translate.en_US.toml | 30 +++--- web/translation/translate.fa_IR.toml | 4 +- web/translation/translate.zh_Hans.toml | 4 +- 22 files changed, 296 insertions(+), 200 deletions(-) diff --git a/.gitignore b/.gitignore index 63ca6b69..7136428c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ .idea tmp -bin/xray-darwin-arm64 -bin/config.json +bin/ dist/ x-ui-*.tar.gz /x-ui diff --git a/config/version b/config/version index be14282b..a6a3a43c 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -0.5.3 +1.0.4 \ No newline at end of file diff --git a/web/assets/js/model/models.js b/web/assets/js/model/models.js index c2404d3b..9fa5e7fc 100644 --- a/web/assets/js/model/models.js +++ b/web/assets/js/model/models.js @@ -151,9 +151,9 @@ class DBInbound { } } - genLink() { + genLink(clientIndex) { const inbound = this.toInbound(); - return inbound.genLink(this.address, this.remark); + return inbound.genLink(this.address, this.remark, clientIndex); } } diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index f5cbb1e0..ccddc591 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -1040,7 +1040,6 @@ class Inbound extends XrayCommonClass { } } - remark = this.settings.vmesses[clientIndex].email ?? remark; let obj = { v: '2', ps: remark, @@ -1063,7 +1062,6 @@ class Inbound extends XrayCommonClass { const port = this.port; const type = this.stream.network; const params = new Map(); - remark = settings.vlesses[clientIndex].email ?? remark; params.set("type", this.stream.network); if (this.xtls) { params.set("security", "xtls"); @@ -1156,7 +1154,6 @@ class Inbound extends XrayCommonClass { const port = this.port; const type = this.stream.network; const params = new Map(); - remark = settings.trojans[clientIndex].email ?? remark; params.set("type", this.stream.network); if (this.xtls) { params.set("security", "xtls"); @@ -1229,10 +1226,22 @@ class Inbound extends XrayCommonClass { genLink(address='', remark='', clientIndex=0) { switch (this.protocol) { - case Protocols.VMESS: return this.genVmessLink(address, remark, clientIndex); - case Protocols.VLESS: return this.genVLESSLink(address, remark, clientIndex); + case Protocols.VMESS: + if (this.settings.vmesses[clientIndex].email != ""){ + remark += '-' + this.settings.vmesses[clientIndex].email + } + return this.genVmessLink(address, remark, clientIndex); + case Protocols.VLESS: + if (this.settings.vlesses[clientIndex].email != ""){ + remark += '-' + this.settings.vlesses[clientIndex].email + } + return this.genVLESSLink(address, remark, clientIndex); case Protocols.SHADOWSOCKS: return this.genSSLink(address, remark); - case Protocols.TROJAN: return this.genTrojanLink(address, remark, clientIndex); + case Protocols.TROJAN: + if (this.settings.trojans[clientIndex].email != ""){ + remark += '-' + this.settings.trojans[clientIndex].email + } + return this.genTrojanLink(address, remark, clientIndex); default: return ''; } } diff --git a/web/assets/js/util/common.js b/web/assets/js/util/common.js index 7225e4ba..b3ebc0bd 100644 --- a/web/assets/js/util/common.js +++ b/web/assets/js/util/common.js @@ -54,4 +54,16 @@ function addZero(num) { function toFixed(num, n) { n = Math.pow(10, n); return Math.round(num * n) / n; -} \ No newline at end of file +} + +function debounce (fn, delay) { + var timeoutID = null + return function () { + clearTimeout(timeoutID) + var args = arguments + var that = this + timeoutID = setTimeout(function () { + fn.apply(that, args) + }, delay) + } + } \ No newline at end of file diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 771f3241..84291829 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -2,26 +2,7 @@ - click on QR Code to Copy - - - - - - - + diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index 69c67052..fa5a2032 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -12,7 +12,7 @@ Email - + - + none [[ key ]] @@ -60,7 +60,7 @@ @@ -104,7 +104,7 @@ - + @@ -121,19 +121,19 @@ - + - + - + - + - + diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html index e858906e..5d56fdd3 100644 --- a/web/html/xui/form/protocol/vless.html +++ b/web/html/xui/form/protocol/vless.html @@ -12,7 +12,7 @@ Email - + @@ -71,7 +71,7 @@ @@ -118,7 +118,7 @@ - + @@ -135,19 +135,19 @@ - + - + - + - + - + diff --git a/web/html/xui/form/protocol/vmess.html b/web/html/xui/form/protocol/vmess.html index df532767..9ed444c6 100644 --- a/web/html/xui/form/protocol/vmess.html +++ b/web/html/xui/form/protocol/vmess.html @@ -11,7 +11,7 @@ Email - + @@ -56,7 +56,7 @@ diff --git a/web/html/xui/form/sniffing.html b/web/html/xui/form/sniffing.html index 838c92fc..6bfab7c1 100644 --- a/web/html/xui/form/sniffing.html +++ b/web/html/xui/form/sniffing.html @@ -2,7 +2,7 @@ - sniffing + Sniffing {{ i18n "unlimited" }} -