|
@@ -65,6 +65,14 @@
|
|
|
<a-space direction="horizontal">
|
|
|
<a-button type="primary" :disabled="saveBtnDisable" @click="updateXraySetting">{{ i18n "pages.xray.save" }}</a-button>
|
|
|
<a-button type="danger" :disabled="!saveBtnDisable" @click="restartXray">{{ i18n "pages.xray.restart" }}</a-button>
|
|
|
+ <a-popover v-if="restartResult"
|
|
|
+ :overlay-class-name="themeSwitcher.currentTheme">
|
|
|
+ <span slot="title" style="font-size: 12pt">Error in running xray-core</span>
|
|
|
+ <template slot="content">
|
|
|
+ <p style="max-width: 400px" v-for="line in restartResult.split('\n')">[[ line ]]</p>
|
|
|
+ </template>
|
|
|
+ <a-icon type="question-circle" theme="filled"></a-icon>
|
|
|
+ </a-popover>
|
|
|
</a-space>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="16">
|
|
@@ -462,6 +470,7 @@
|
|
|
xraySetting: '',
|
|
|
inboundTags: [],
|
|
|
saveBtnDisable: true,
|
|
|
+ restartResult: '',
|
|
|
isMobile: window.innerWidth <= 768,
|
|
|
advSettings: 'xraySetting',
|
|
|
cm: null,
|
|
@@ -586,8 +595,17 @@
|
|
|
const msg = await HttpUtil.post("server/restartXrayService");
|
|
|
this.loading(false);
|
|
|
if (msg.success) {
|
|
|
- this.loading(true);
|
|
|
+ await PromiseUtil.sleep(500);
|
|
|
+ await this.getXrayResult();
|
|
|
}
|
|
|
+ this.loading(false);
|
|
|
+ },
|
|
|
+ async getXrayResult() {
|
|
|
+ const msg = await HttpUtil.get("/panel/xray/getXrayResult");
|
|
|
+ if(msg.success){
|
|
|
+ this.restartResult=msg.obj;
|
|
|
+ if(msg.obj.length > 1) Vue.prototype.$message.error(msg.obj);
|
|
|
+ }
|
|
|
},
|
|
|
async fetchUserSecret() {
|
|
|
this.loading(true);
|
|
@@ -896,6 +914,7 @@
|
|
|
},
|
|
|
async mounted() {
|
|
|
await this.getXraySetting();
|
|
|
+ await this.getXrayResult();
|
|
|
while (true) {
|
|
|
await PromiseUtil.sleep(600);
|
|
|
this.saveBtnDisable = this.oldXraySetting === this.xraySetting;
|