From 4cb67fd1c3129b83f3750f863caba081453f42b1 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Sun, 10 Dec 2023 12:57:39 +0100 Subject: [xray] show xray errors #1300 --- web/html/xui/xray.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'web/html') diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index cdf5fd01..99b1878d 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -65,6 +65,14 @@ {{ i18n "pages.xray.save" }} {{ i18n "pages.xray.restart" }} + + Error in running xray-core + + + @@ -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; -- cgit v1.2.3