[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: {
get: function () {
const parsedSettings = this.xraySetting ? JSON.parse(this.xraySetting) : null;
let accessLogPath = "./access.log";
let errorLogPath = "./error.log";
if (parsedSettings) {
this.access = ["none", parsedSettings.log.access];
this.error = ["none", parsedSettings.log.error];
} else {
this.access = ["none", "./access.log"];
this.error = ["none", "./error.log"];
// if its set to "none" add default value
if (parsedSettings.log.access !== "none") accessLogPath = parsedSettings.log.access;
if (parsedSettings.log.error !== "none") errorLogPath = parsedSettings.log.error;
}
this.access = ["none", accessLogPath];
this.error = ["none", errorLogPath];
return parsedSettings;
},
set: function (newValue) {