From 419a1938ee51e011f079777e8b6ac83d908e5366 Mon Sep 17 00:00:00 2001 From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> Date: Sat, 20 May 2023 18:57:10 +0430 Subject: update settings ui --- web/html/xui/settings.html | 86 ++++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 29 deletions(-) (limited to 'web/html/xui/settings.html') diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 3dd1f57b..acff52f3 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -23,6 +23,34 @@ :not(.ant-card-dark)>.ant-tabs-top-bar { background: white; } + + .alert-msg { + color: rgb(194, 117, 18); + font-weight: bold; + font-size: 20px; + margin-top: 5px; + padding: 16px 6px; + text-align: center; + border-bottom: 1px solid; + } + + .alert-msg > i { + color: inherit; + font-size: 24px; + } + + .collapse-title { + color: inherit; + font-weight: bold; + font-size: 18px; + padding: 10px 20px; + border-bottom: 2px solid; + } + + .collapse-title > i { + color: inherit; + font-size: 24px; + } @@ -35,8 +63,14 @@ {{ i18n "pages.settings.save" }} {{ i18n "pages.settings.restartPanel" }} - + + +

+ + {{ i18n "pages.settings.infoDesc" }} +

+
@@ -72,12 +106,6 @@ - -

- - {{ i18n "pages.settings.infoDesc" }} -

-
@@ -144,8 +172,8 @@ {{ i18n "pages.settings.templates.title"}} -

- +

+ {{ i18n "pages.settings.infoDesc" }}

@@ -154,8 +182,8 @@ -

- +

+ {{ i18n "pages.settings.templates.generalConfigsDesc" }}

@@ -199,8 +227,8 @@
-

- +

+ {{ i18n "pages.settings.templates.blockConfigsDesc" }}

@@ -212,8 +240,8 @@
-

- +

+ {{ i18n "pages.settings.templates.blockCountryConfigsDesc" }}

@@ -226,8 +254,8 @@
-

- +

+ {{ i18n "pages.settings.templates.directCountryConfigsDesc" }}

@@ -240,8 +268,8 @@
-

- +

+ {{ i18n "pages.settings.templates.ipv4ConfigsDesc" }}

@@ -250,8 +278,8 @@
-

- +

+ {{ i18n "pages.settings.templates.warpConfigsDesc" }}

@@ -262,8 +290,8 @@
-

- +

+ {{ i18n "pages.settings.templates.manualListsDesc" }}

@@ -295,6 +323,12 @@
+ +

+ + {{ i18n "pages.settings.infoDesc" }} +

+
@@ -303,12 +337,6 @@ - -

- - {{ i18n "pages.settings.infoDesc" }} -

-
-- cgit v1.2.3 From c7e300f14d5fc8cb4d025892461a766fa8308562 Mon Sep 17 00:00:00 2001 From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> Date: Sat, 20 May 2023 18:58:51 +0430 Subject: FIX redirect after restart panel --- web/html/xui/settings.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/html/xui/settings.html') diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index acff52f3..8f9e2b7b 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -480,7 +480,12 @@ if (msg.success) { this.loading(true); await PromiseUtil.sleep(5000); - window.location.replace(this.allSetting.webBasePath + "panel/settings"); + let protocol = "http://"; + if (this.allSetting.webCertFile !== "") { + protocol = "https://"; + } + const { host, pathname } = window.location; + window.location.replace(protocol + host + this.allSetting.webBasePath + pathname.slice(1)); } }, async fetchUserSecret() { -- cgit v1.2.3 From f50ccce9ec7d920919fd28a1fa2ac2b0b9b44e37 Mon Sep 17 00:00:00 2001 From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> Date: Sat, 20 May 2023 19:02:37 +0430 Subject: Add manual list for ipv4 and warp and fixed it --- web/html/xui/settings.html | 120 ++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 67 deletions(-) (limited to 'web/html/xui/settings.html') diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 8f9e2b7b..7dd503a6 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -299,6 +299,8 @@ + + @@ -617,30 +619,30 @@ computed: { templateSettings: { get: function () { return this.allSetting.xrayTemplateConfig ? JSON.parse(this.allSetting.xrayTemplateConfig) : null; }, - set: function (newValue) { this.allSetting.xrayTemplateConfig = JSON.stringify(newValue, null, 2) }, + set: function (newValue) { this.allSetting.xrayTemplateConfig = JSON.stringify(newValue, null, 2); }, }, inboundSettings: { get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; }, set: function (newValue) { newTemplateSettings = this.templateSettings; - newTemplateSettings.inbounds = JSON.parse(newValue) - this.templateSettings = newTemplateSettings + newTemplateSettings.inbounds = JSON.parse(newValue); + this.templateSettings = newTemplateSettings; }, }, outboundSettings: { get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.outbounds, null, 2) : null; }, set: function (newValue) { newTemplateSettings = this.templateSettings; - newTemplateSettings.outbounds = JSON.parse(newValue) - this.templateSettings = newTemplateSettings + newTemplateSettings.outbounds = JSON.parse(newValue); + this.templateSettings = newTemplateSettings; }, }, routingRuleSettings: { get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.routing.rules, null, 2) : null; }, set: function (newValue) { newTemplateSettings = this.templateSettings; - newTemplateSettings.routing.rules = JSON.parse(newValue) - this.templateSettings = newTemplateSettings + newTemplateSettings.routing.rules = JSON.parse(newValue); + this.templateSettings = newTemplateSettings; }, }, freedomStrategy: { @@ -715,6 +717,24 @@ this.syncRulesWithOutbound("direct", this.directSettings); } }, + ipv4Domains: { + get: function () { + return this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" }); + }, + set: function (newValue) { + this.templateRuleSetter({ outboundTag: "IPv4", property: "domain", data: newValue }); + this.syncRulesWithOutbound("IPv4", this.ipv4Settings); + } + }, + warpDomains: { + get: function () { + return this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); + }, + set: function (newValue) { + this.templateRuleSetter({ outboundTag: "WARP", property: "domain", data: newValue }); + this.syncRulesWithOutbound("WARP", this.warpSettings); + } + }, manualBlockedIPs: { get: function () { return JSON.stringify(this.blockedIPs, null, 2); }, set: debounce(function (value) { this.blockedIPs = JSON.parse(value); }, 1000) @@ -731,6 +751,14 @@ get: function () { return JSON.stringify(this.directDomains, null, 2); }, set: debounce(function (value) { this.directDomains = JSON.parse(value); }, 1000) }, + manualIPv4Domains: { + get: function () { return JSON.stringify(this.ipv4Domains, null, 2); }, + set: debounce(function (value) { this.ipv4Domains = JSON.parse(value); }, 1000) + }, + manualWARPDomains: { + get: function () { return JSON.stringify(this.warpDomains, null, 2); }, + set: debounce(function (value) { this.warpDomains = JSON.parse(value); }, 1000) + }, torrentSettings: { get: function () { return doAllItemsExist(this.settingsData.protocols.bittorrent, this.blockedProtocols); @@ -796,40 +824,26 @@ }, GoogleIPv4Settings: { get: function () { - return doAllItemsExist(this.settingsData.domains.google, this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.google, this.ipv4Domains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.google]; + this.ipv4Domains = [...this.ipv4Domains, ...this.settingsData.domains.google]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.google.includes(data)) + this.ipv4Domains = this.ipv4Domains.filter(data => !this.settingsData.domains.google.includes(data)); } - this.templateRuleSetter({ - outboundTag: "IPv4", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("IPv4", this.ipv4Settings); }, }, NetflixIPv4Settings: { get: function () { - return doAllItemsExist(this.settingsData.domains.netflix, this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.netflix, this.ipv4Domains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "IPv4", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.netflix]; + this.ipv4Domains = [...this.ipv4Domains, ...this.settingsData.domains.netflix]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.netflix.includes(data)) + this.ipv4Domains = this.ipv4Domains.filter(data => !this.settingsData.domains.netflix.includes(data)); } - this.templateRuleSetter({ - outboundTag: "IPv4", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("IPv4", this.ipv4Settings); }, }, IRIpSettings: { @@ -978,78 +992,50 @@ }, GoogleWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.google, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.google, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.google]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.google]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.google.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.google.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, OpenAIWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.openai, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.openai, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.openai]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.openai]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.openai.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.openai.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, NetflixWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.netflix, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.netflix, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.netflix]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.netflix]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.netflix.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.netflix.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, SpotifyWARPSettings: { get: function () { - return doAllItemsExist(this.settingsData.domains.spotify, this.templateRuleGetter({ outboundTag: "WARP", property: "domain" })); + return doAllItemsExist(this.settingsData.domains.spotify, this.warpDomains); }, set: function (newValue) { - oldData = this.templateRuleGetter({ outboundTag: "WARP", property: "domain" }); if (newValue) { - oldData = [...oldData, ...this.settingsData.domains.spotify]; + this.warpDomains = [...this.warpDomains, ...this.settingsData.domains.spotify]; } else { - oldData = oldData.filter(data => !this.settingsData.domains.spotify.includes(data)) + this.warpDomains = this.warpDomains.filter(data => !this.settingsData.domains.spotify.includes(data)); } - this.templateRuleSetter({ - outboundTag: "WARP", - property: "domain", - data: oldData - }); - this.syncRulesWithOutbound("WARP", this.warpSettings); }, }, }, -- cgit v1.2.3 From 91360a3f49895d80d34183a0421f2dcc5d64b18e Mon Sep 17 00:00:00 2001 From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> Date: Sat, 20 May 2023 19:20:54 +0430 Subject: add tgLang to settings --- web/html/xui/settings.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'web/html/xui/settings.html') diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 7dd503a6..f5ea4994 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -338,6 +338,29 @@ + + + + + + + + + + +
-- cgit v1.2.3