From 8489f5f528ea77fec9d6c2102251da9d16e95780 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Sat, 26 Aug 2023 16:01:02 +0330 Subject: [PATCH] some changes Co-Authored-By: Alireza Ahmadi --- web/assets/js/model/models.js | 4 ++-- web/assets/js/model/xray.js | 4 ++-- web/html/common/qrcode_modal.html | 7 ++++--- web/html/xui/inbound_info_modal.html | 7 ++++--- web/html/xui/inbound_modal.html | 2 +- web/service/setting.go | 4 ++-- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/web/assets/js/model/models.js b/web/assets/js/model/models.js index 762d1174..1accec71 100644 --- a/web/assets/js/model/models.js +++ b/web/assets/js/model/models.js @@ -181,7 +181,7 @@ class AllSetting { this.tgBotChatId = ""; this.tgRunTime = "@daily"; this.tgBotBackup = false; - this.tgBotLoginNotify = false; + this.tgBotLoginNotify = true; this.tgCpu = ""; this.tgLang = "en-US"; this.xrayTemplateConfig = ""; @@ -194,7 +194,7 @@ class AllSetting { this.subCertFile = ""; this.subKeyFile = ""; this.subUpdates = 0; - this.subShowInfo = false; + this.subShowInfo = true; this.timeLocation = "Asia/Tehran"; diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 47800884..481bb9a0 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -1659,10 +1659,10 @@ class Inbound extends XrayCommonClass { JSON.parse(this.settings).clients.forEach((client,index) => { if(this.tls && !ObjectUtil.isArrEmpty(this.stream.tls.settings.domains)){ this.stream.tls.settings.domains.forEach((domain) => { - link += this.genLink(domain.domain, remark + '-' + client.email + '-' + domain.remark, index) + '\r\n'; + link += this.genLink(domain.domain, [remark, client.email, domain.remark].filter(x => x.length > 0).join('-'), index) + '\r\n'; }); } else { - link += this.genLink(address, remark + '-' + client.email, index) + '\r\n'; + link += this.genLink(address, [remark, client.email].filter(x => x.length > 0).join('-'), index) + '\r\n'; } }); return link; diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index 28404eb6..0b815690 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -37,15 +37,16 @@ this.inbound = dbInbound.toInbound(); settings = JSON.parse(this.inbound.settings); this.client = settings.clients[clientIndex]; - remark = this.dbInbound.remark + ( this.client ? "-" + this.client.email : ''); + remark = [this.dbInbound.remark, ( this.client ? this.client.email : '')].filter(Boolean).join('-'); address = this.dbInbound.address; this.subId = ''; this.qrcodes = []; if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) { this.inbound.stream.tls.settings.domains.forEach((domain) => { + remarkText = [remark, domain.remark].filter(Boolean).join('-'); this.qrcodes.push({ - remark: remark + "-" + domain.remark, - link: this.inbound.genLink(domain.domain, remark + "-" + domain.remark, clientIndex) + remark: remarkText, + link: this.inbound.genLink(domain.domain, remarkText, clientIndex) }); }); } else { diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index 42b169fc..c162c1af 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -264,14 +264,15 @@ 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 ? "-" + this.clientSettings.email : ''); + remark = [this.dbInbound.remark, ( this.clientSettings ? this.clientSettings.email : '')].filter(Boolean).join('-'); address = this.dbInbound.address; this.links = []; if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) { this.inbound.stream.tls.settings.domains.forEach((domain) => { + remarkText = [remark, domain.remark].filter(Boolean).join('-'); this.links.push({ - remark: remark + "-" + domain.remark, - link: this.inbound.genLink(domain.domain, remark + "-" + domain.remark, index) + remark: remarkText, + link: this.inbound.genLink(domain.domain, remarkText, index) }); }); } else { diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index a10692cc..a18d7731 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -110,7 +110,7 @@ if (this.inModal.inbound.settings.shadowsockses.length ==0){ this.inModal.inbound.settings.shadowsockses = [new Inbound.ShadowsocksSettings.Shadowsocks()]; } - if (["aes-128-gcm", "aes-256-gcm", "chacha20-poly1305", "xchacha20-poly1305"].includes(this.inModal.inbound.settings.method)) { + if (!this.inModal.inbound.isSS2022) { this.inModal.inbound.settings.shadowsockses.forEach(client => { client.method = this.inModal.inbound.settings.method; }) diff --git a/web/service/setting.go b/web/service/setting.go index 585e60c7..6f38f1ef 100644 --- a/web/service/setting.go +++ b/web/service/setting.go @@ -39,7 +39,7 @@ var defaultValueMap = map[string]string{ "tgBotChatId": "", "tgRunTime": "@daily", "tgBotBackup": "false", - "tgBotLoginNotify": "false", + "tgBotLoginNotify": "true", "tgCpu": "0", "tgLang": "en-US", "secretEnable": "false", @@ -51,7 +51,7 @@ var defaultValueMap = map[string]string{ "subCertFile": "", "subKeyFile": "", "subUpdates": "12", - "subShowInfo": "false", + "subShowInfo": "true", } type SettingService struct {