From f5aea03765dcf613db75cc9141b9a5eac32d1ff0 Mon Sep 17 00:00:00 2001
From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com>
Date: Tue, 4 Mar 2025 20:18:51 +0700
Subject: chore: add global params for DNS (#2713)
parameter list: `disableCache`, `disableFallback`, `disableFallbackIfMatch`, `clientIp`
---
web/html/xui/xray.html | 110 +++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 101 insertions(+), 9 deletions(-)
(limited to 'web/html/xui')
diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html
index 78f48476..3a078eee 100644
--- a/web/html/xui/xray.html
+++ b/web/html/xui/xray.html
@@ -673,9 +673,7 @@
-
-
-
+
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1971,7 +2003,11 @@
set: function (newValue) {
newTemplateSettings = this.templateSettings;
if (newValue) {
- newTemplateSettings.dns = { servers: [], queryStrategy: "UseIP", tag: "dns_inbound" };
+ newTemplateSettings.dns = {
+ servers: [],
+ queryStrategy: "UseIP",
+ tag: "dns_inbound"
+ };
newTemplateSettings.fakedns = null;
} else {
delete newTemplateSettings.dns;
@@ -1986,7 +2022,63 @@
},
set: function (newValue) {
newTemplateSettings = this.templateSettings;
- newTemplateSettings.dns.tag = newValue;
+ newTemplateSettings.dns.tag = newValue;
+ this.templateSettings = newTemplateSettings;
+ }
+ },
+ dnsClientIp: {
+ get: function () {
+ return this.enableDNS ? this.templateSettings.dns.clientIp : null;
+ },
+ set: function (newValue) {
+ newTemplateSettings = this.templateSettings;
+ if (newValue) {
+ newTemplateSettings.dns.clientIp = newValue;
+ } else {
+ delete newTemplateSettings.dns.clientIp;
+ }
+ this.templateSettings = newTemplateSettings;
+ }
+ },
+ dnsDisableCache: {
+ get: function () {
+ return this.enableDNS ? this.templateSettings.dns.disableCache : false;
+ },
+ set: function (newValue) {
+ newTemplateSettings = this.templateSettings;
+ if (newValue) {
+ newTemplateSettings.dns.disableCache = newValue;
+ } else {
+ delete newTemplateSettings.dns.disableCache
+ }
+ this.templateSettings = newTemplateSettings;
+ }
+ },
+ dnsDisableFallback: {
+ get: function () {
+ return this.enableDNS ? this.templateSettings.dns.disableFallback : false;
+ },
+ set: function (newValue) {
+ newTemplateSettings = this.templateSettings;
+ if (newValue) {
+ newTemplateSettings.dns.disableFallback = newValue;
+ } else {
+ delete newTemplateSettings.dns.disableFallback
+ }
+ this.templateSettings = newTemplateSettings;
+ }
+ },
+ dnsDisableFallbackIfMatch: {
+ get: function () {
+ return this.enableDNS ? this.templateSettings.dns.disableFallbackIfMatch : false;
+ },
+ set: function (newValue) {
+ newTemplateSettings = this.templateSettings;
+ if (newValue) {
+ newTemplateSettings.dns.disableFallbackIfMatch = newValue;
+ } else {
+ delete newTemplateSettings.dns.disableFallbackIfMatch
+ }
this.templateSettings = newTemplateSettings;
}
},
--
cgit v1.2.3