[fix] set correct value if log paths is set to 'none'

we also use the default value for the paths if its set to none
This commit is contained in:
Hamidreza Ghavami 2024-03-11 00:35:28 +03:30
parent fb1f99e98d
commit 15f75f1769
No known key found for this signature in database
GPG key ID: 402C6797325182D9

View file

@ -1405,13 +1405,15 @@
templateSettings: { templateSettings: {
get: function () { get: function () {
const parsedSettings = this.xraySetting ? JSON.parse(this.xraySetting) : null; const parsedSettings = this.xraySetting ? JSON.parse(this.xraySetting) : null;
let accessLogPath = "./access.log";
let errorLogPath = "./error.log";
if (parsedSettings) { if (parsedSettings) {
this.access = ["none", parsedSettings.log.access]; // if its set to "none" add default value
this.error = ["none", parsedSettings.log.error]; if (parsedSettings.log.access !== "none") accessLogPath = parsedSettings.log.access;
} else { if (parsedSettings.log.error !== "none") errorLogPath = parsedSettings.log.error;
this.access = ["none", "./access.log"];
this.error = ["none", "./error.log"];
} }
this.access = ["none", accessLogPath];
this.error = ["none", errorLogPath];
return parsedSettings; return parsedSettings;
}, },
set: function (newValue) { set: function (newValue) {