mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-09 19:56:19 +00:00
[fix] set select options from logs paths in xray settings
This commit is contained in:
parent
76cce395f4
commit
60fdde2433
1 changed files with 27 additions and 13 deletions
|
@ -180,7 +180,7 @@
|
||||||
<a-col :lg="24" :xl="12">
|
<a-col :lg="24" :xl="12">
|
||||||
<template>
|
<template>
|
||||||
<a-select v-model="accessLog" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%">
|
<a-select v-model="accessLog" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%">
|
||||||
<a-select-option v-for="s in access" :value="s">[[ s ]]</a-select-option>
|
<a-select-option v-for="s in access" :key="s" :value="s">[[ s ]]</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</template>
|
</template>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
<a-col :lg="24" :xl="12">
|
<a-col :lg="24" :xl="12">
|
||||||
<template>
|
<template>
|
||||||
<a-select v-model="errorLog" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%">
|
<a-select v-model="errorLog" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%">
|
||||||
<a-select-option v-for="s in error" :value="s">[[ s ]]</a-select-option>
|
<a-select-option v-for="s in error" :key="s" :value="s">[[ s ]]</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
</template>
|
</template>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -765,8 +765,8 @@
|
||||||
},
|
},
|
||||||
routingDomainStrategies: ["AsIs", "IPIfNonMatch", "IPOnDemand"],
|
routingDomainStrategies: ["AsIs", "IPIfNonMatch", "IPOnDemand"],
|
||||||
logLevel: ["none" , "debug" , "info" , "warning", "error"],
|
logLevel: ["none" , "debug" , "info" , "warning", "error"],
|
||||||
access: ["none" , "./access.log" ],
|
access: [],
|
||||||
error: ["none" , "./error.log" ],
|
error: [],
|
||||||
settingsData: {
|
settingsData: {
|
||||||
protocols: {
|
protocols: {
|
||||||
bittorrent: ["bittorrent"],
|
bittorrent: ["bittorrent"],
|
||||||
|
@ -869,10 +869,10 @@
|
||||||
},
|
},
|
||||||
async getXrayResult() {
|
async getXrayResult() {
|
||||||
const msg = await HttpUtil.get("/panel/xray/getXrayResult");
|
const msg = await HttpUtil.get("/panel/xray/getXrayResult");
|
||||||
if(msg.success){
|
if (msg.success) {
|
||||||
this.restartResult=msg.obj;
|
this.restartResult=msg.obj;
|
||||||
if(msg.obj.length > 1) Vue.prototype.$message.error(msg.obj);
|
if(msg.obj.length > 1) Vue.prototype.$message.error(msg.obj);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fetchUserSecret() {
|
async fetchUserSecret() {
|
||||||
this.loading(true);
|
this.loading(true);
|
||||||
|
@ -910,9 +910,9 @@
|
||||||
},
|
},
|
||||||
async toggleToken(value) {
|
async toggleToken(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
await this.getNewSecret();
|
await this.getNewSecret();
|
||||||
} else {
|
} else {
|
||||||
this.user.loginSecret = "";
|
this.user.loginSecret = "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async resetXrayConfigToDefault() {
|
async resetXrayConfigToDefault() {
|
||||||
|
@ -1001,7 +1001,7 @@
|
||||||
this.cm = CodeMirror.fromTextArea(textAreaObj, this.cmOptions);
|
this.cm = CodeMirror.fromTextArea(textAreaObj, this.cmOptions);
|
||||||
this.cm.on('change',editor => {
|
this.cm.on('change',editor => {
|
||||||
value = editor.getValue();
|
value = editor.getValue();
|
||||||
if(this.isJsonString(value)){
|
if (this.isJsonString(value)) {
|
||||||
this[this.advSettings] = value;
|
this[this.advSettings] = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1403,8 +1403,22 @@
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
templateSettings: {
|
templateSettings: {
|
||||||
get: function () { return this.xraySetting ? JSON.parse(this.xraySetting) : null; },
|
get: function () {
|
||||||
set: function (newValue) { this.xraySetting = JSON.stringify(newValue, null, 2); },
|
const parsedSettings = this.xraySetting ? JSON.parse(this.xraySetting) : null;
|
||||||
|
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"];
|
||||||
|
}
|
||||||
|
return parsedSettings;
|
||||||
|
},
|
||||||
|
set: function (newValue) {
|
||||||
|
this.xraySetting = JSON.stringify(newValue, null, 2);
|
||||||
|
this.access = ["none", newValue.log.access];
|
||||||
|
this.error = ["none", newValue.log.error];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
inboundSettings: {
|
inboundSettings: {
|
||||||
get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; },
|
get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; },
|
||||||
|
|
Loading…
Reference in a new issue