From 65588a44922ea062cc438c43957f131ba54a1404 Mon Sep 17 00:00:00 2001
From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com>
Date: Fri, 12 May 2023 19:30:49 +0430
Subject: add check for geosite function
---
web/html/xui/settings.html | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
(limited to 'web/html/xui/settings.html')
diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html
index d50822c2..d4b4c028 100644
--- a/web/html/xui/settings.html
+++ b/web/html/xui/settings.html
@@ -307,6 +307,9 @@
},
}
},
+ created() {
+ this.checkForGeosites();
+ },
methods: {
loading(spinning = true, obj) {
if (obj == null) this.spinning = spinning;
@@ -401,6 +404,27 @@
this.saveBtnDisable = true;
}
},
+ checkForGeosites() {
+ const domainsToCheck = [
+ {
+ query: "category-ru-gov",
+ key: "this.settingsData.domains.ru",
+ data: [
+ "geosite:category-ru-gov",
+ "regexp:.*\\.ru$"
+ ]
+ },
+ ];
+ this.loading(true);
+ domainsToCheck.forEach(async (dd) => {
+ const msg = await HttpUtil.get(`/xui/setting/searchDatafiles?query=${dd.query}`);
+ if (msg.success && msg.obj) {
+ [dd.key] = dd.data;
+ console.log([dd.key])
+ }
+ })
+ this.loading(false);
+ },
checkRequiredOutbounds() {
const newTemplateSettings = this.templateSettings;
const haveIPv4Outbounds = newTemplateSettings.outbounds.some((o) => o?.tag === "IPv4");
--
cgit v1.2.3
From a6a77688dc4919b0966d7da98aee16fb7e0b1131 Mon Sep 17 00:00:00 2001
From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com>
Date: Fri, 12 May 2023 21:58:28 +0430
Subject: Add block speedtest switch template
---
web/html/xui/settings.html | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
(limited to 'web/html/xui/settings.html')
diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html
index d4b4c028..94364eb7 100644
--- a/web/html/xui/settings.html
+++ b/web/html/xui/settings.html
@@ -153,6 +153,7 @@
+
@@ -285,6 +286,7 @@
"geosite:spotify-ads"
],
porn: ["geosite:category-porn"],
+ speedtest: ["geosite:speedtest"],
openai: ["geosite:openai"],
google: ["geosite:google"],
spotify: ["geosite:spotify"],
@@ -597,6 +599,23 @@
});
},
},
+ SpeedTestSettings: {
+ get: function () {
+ return this.templateRuleGetter({
+ outboundTag: "blocked",
+ property: "domain",
+ data: this.settingsData.domains.speedtest
+ });
+ },
+ set: function (newValue) {
+ this.templateRuleSetter({
+ newValue,
+ outboundTag: "blocked",
+ property: "domain",
+ data: this.settingsData.domains.speedtest
+ });
+ },
+ },
GoogleIPv4Settings: {
get: function () {
return this.templateRuleGetter({
--
cgit v1.2.3
From b0871a6ef650e3776fd0f76799e698c20bed1fd2 Mon Sep 17 00:00:00 2001
From: Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com>
Date: Fri, 12 May 2023 22:36:05 +0430
Subject: Change route path '/xui' to '/panel'
---
web/html/xui/settings.html | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
(limited to 'web/html/xui/settings.html')
diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html
index 94364eb7..9dec0e0c 100644
--- a/web/html/xui/settings.html
+++ b/web/html/xui/settings.html
@@ -318,7 +318,7 @@
},
async getAllSetting() {
this.loading(true);
- const msg = await HttpUtil.post("/xui/setting/all");
+ const msg = await HttpUtil.post("/panel/setting/all");
this.loading(false);
if (msg.success) {
this.oldAllSetting = new AllSetting(msg.obj);
@@ -329,7 +329,7 @@
},
async updateAllSetting() {
this.loading(true);
- const msg = await HttpUtil.post("/xui/setting/update", this.allSetting);
+ const msg = await HttpUtil.post("/panel/setting/update", this.allSetting);
this.loading(false);
if (msg.success) {
await this.getAllSetting();
@@ -337,7 +337,7 @@
},
async updateUser() {
this.loading(true);
- const msg = await HttpUtil.post("/xui/setting/updateUser", this.user);
+ const msg = await HttpUtil.post("/panel/setting/updateUser", this.user);
this.loading(false);
if (msg.success) {
this.user = {};
@@ -355,7 +355,7 @@
});
});
this.loading(true);
- const msg = await HttpUtil.post("/xui/setting/restartPanel");
+ const msg = await HttpUtil.post("/panel/setting/restartPanel");
this.loading(false);
if (msg.success) {
this.loading(true);
@@ -364,7 +364,7 @@
}
},
async getUserSecret() {
- const user_msg = await HttpUtil.post("/xui/setting/getUserSecret", this.user);
+ const user_msg = await HttpUtil.post("/panel/setting/getUserSecret", this.user);
if (user_msg.success) {
this.user = user_msg.obj;
}
@@ -372,7 +372,7 @@
},
async updateSecret() {
this.loading(true);
- const msg = await HttpUtil.post("/xui/setting/updateUserSecret", this.user);
+ const msg = await HttpUtil.post("/panel/setting/updateUserSecret", this.user);
if (msg.success) {
this.user = msg.obj;
window.location.replace(basePath + "logout")
@@ -399,7 +399,7 @@
},
async resetXrayConfigToDefault() {
this.loading(true);
- const msg = await HttpUtil.get("/xui/setting/getDefaultJsonConfig");
+ const msg = await HttpUtil.get("/panel/setting/getDefaultJsonConfig");
this.loading(false);
if (msg.success) {
this.templateSettings = JSON.parse(JSON.stringify(msg.obj, null, 2));
@@ -419,7 +419,7 @@
];
this.loading(true);
domainsToCheck.forEach(async (dd) => {
- const msg = await HttpUtil.get(`/xui/setting/searchDatafiles?query=${dd.query}`);
+ const msg = await HttpUtil.get(`/panel/setting/searchDatafiles?query=${dd.query}`);
if (msg.success && msg.obj) {
[dd.key] = dd.data;
console.log([dd.key])
--
cgit v1.2.3