From 12dfe8a35f74fc8ffe5cae6664d8e1576c5b3390 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Mon, 4 Dec 2023 20:00:58 +0100 Subject: Restart xray in xray page #1286 --- web/html/xui/xray.html | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'web/html/xui/xray.html') diff --git a/web/html/xui/xray.html b/web/html/xui/xray.html index 5c4cb302..198ba093 100644 --- a/web/html/xui/xray.html +++ b/web/html/xui/xray.html @@ -47,8 +47,8 @@ - {{ i18n "pages.settings.save" }} - {{ i18n "pages.settings.restartPanel" }} + {{ i18n "pages.xray.save" }} + {{ i18n "pages.xray.restart" }} @@ -332,28 +332,11 @@ } }, async restartPanel() { - await new Promise(resolve => { - this.$confirm({ - title: '{{ i18n "pages.settings.restartPanel" }}', - content: '{{ i18n "pages.settings.restartPanelDesc" }}', - class: themeSwitcher.currentTheme, - okText: '{{ i18n "sure" }}', - cancelText: '{{ i18n "cancel" }}', - onOk: () => resolve(), - }); - }); this.loading(true); - const msg = await HttpUtil.post("/panel/setting/restartPanel"); + const msg = await HttpUtil.post("server/restartXrayService"); this.loading(false); if (msg.success) { this.loading(true); - await PromiseUtil.sleep(5000); - var { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.xraySetting; - if (host == this.oldXraySetting.webDomain) host = null; - if (port == this.oldXraySetting.webPort) port = null; - const isTLS = webCertFile !== "" || webKeyFile !== ""; - const url = buildURL({ host, port, isTLS, base, path: "panel/settings" }); - window.location.replace(url); } }, async fetchUserSecret() { -- cgit v1.2.3