From 33d983bc20c511ff525c42b1666806d83c387ff4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Thu, 12 Sep 2024 11:44:13 +0200 Subject: New - maskAddress , dnslog --- web/html/xui/xray.html | 78 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 25 deletions(-) (limited to 'web/html/xui') diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index 2a4989a7..a4965cf5 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -163,8 +163,8 @@ @@ -178,7 +178,8 @@ @@ -192,11 +193,28 @@ + + + + + + + + + + @@ -791,9 +809,13 @@ protocol: "freedom" }, routingDomainStrategies: ["AsIs", "IPIfNonMatch", "IPOnDemand"], - logLevel: ["none" , "debug" , "info" , "warning", "error"], - access: [], - error: [], + log: { + loglevel: ["none", "debug", "info", "warning", "error"], + access: ["none", "./access.log"], + error: ["none", "./error.log"], + dnsLog: false, + maskAddress: ["quarter", "half", "full"], + }, settingsData: { protocols: { bittorrent: ["bittorrent"], @@ -1519,27 +1541,11 @@ templateSettings: { get: function () { const parsedSettings = this.xraySetting ? JSON.parse(this.xraySetting) : null; - let accessLogPath = "./access.log"; - let errorLogPath = "./error.log"; - - if (parsedSettings && parsedSettings.log) { - if (parsedSettings.log.access && parsedSettings.log.access !== "none") { - accessLogPath = parsedSettings.log.access; - } - if (parsedSettings.log.error && parsedSettings.log.error !== "none") { - errorLogPath = parsedSettings.log.error; - } - } - - this.access = ["none", accessLogPath]; - this.error = ["none", errorLogPath]; return parsedSettings; }, set: function (newValue) { - if (newValue && newValue.log) { + if (newValue) { this.xraySetting = JSON.stringify(newValue, null, 2); - this.access = ["none", newValue.log.access || "./access.log"]; - this.error = ["none", newValue.log.error || "./error.log"]; } }, }, @@ -1688,7 +1694,7 @@ this.templateSettings = newTemplateSettings; } }, - setLogLevel: { + logLevel: { get: function () { if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.loglevel) return "warning"; return this.templateSettings.log.loglevel; @@ -1721,6 +1727,28 @@ this.templateSettings = newTemplateSettings; } }, + dnslog: { + get: function () { + if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.dnsLog) return false; + return this.templateSettings.log.dnsLog; + }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.log.dnsLog = newValue; + this.templateSettings = newTemplateSettings; + } + }, + maskAddressLog: { + get: function () { + if (!this.templateSettings || !this.templateSettings.log || !this.templateSettings.log.maskAddress) return ""; + return this.templateSettings.log.maskAddress; + }, + set: function (newValue) { + newTemplateSettings = this.templateSettings; + newTemplateSettings.log.maskAddress = newValue; + this.templateSettings = newTemplateSettings; + } + }, blockedIPs: { get: function () { return this.templateRuleGetter({ outboundTag: "blocked", property: "ip" }); -- cgit v1.2.3