From 12dfe8a35f74fc8ffe5cae6664d8e1576c5b3390 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Mon, 4 Dec 2023 20:00:58 +0100 Subject: [PATCH] Restart xray in xray page #1286 --- web/html/xui/xray.html | 23 +++-------------------- web/translation/translate.en_US.toml | 2 ++ web/translation/translate.es_ES.toml | 2 ++ web/translation/translate.fa_IR.toml | 2 ++ web/translation/translate.ru_RU.toml | 2 ++ web/translation/translate.vi_VN.toml | 2 ++ web/translation/translate.zh_Hans.toml | 2 ++ 7 files changed, 15 insertions(+), 20 deletions(-) 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() { diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index 8790beee..6df93054 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -287,6 +287,8 @@ [pages.xray] "title" = "Xray Settings" +"save" = "Save Settings" +"restart" = "Reastart Xray" "basicTemplate" = "Basic Template" "advancedTemplate" = "Advanced Template" "completeTemplate" = "Complete Template" diff --git a/web/translation/translate.es_ES.toml b/web/translation/translate.es_ES.toml index 36e21d42..54b3e81c 100644 --- a/web/translation/translate.es_ES.toml +++ b/web/translation/translate.es_ES.toml @@ -287,6 +287,8 @@ [pages.xray] "title" = "Xray Configuración" +"save" = "Guardar configuración" +"restart" = "Reiniciar Xray" "basicTemplate" = "Plantilla Básica" "advancedTemplate" = "Plantilla Avanzada" "completeTemplate" = "Plantilla Completa" diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index 65ce6f05..71254572 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -287,6 +287,8 @@ [pages.xray] "title" = "الگوها" +"save" = "ذخیره تنظیمات" +"restart" = "ریستارت ایکس‌ری" "basicTemplate" = "بخش الگو پایه" "advancedTemplate" = "بخش الگو پیشرفته" "completeTemplate" = "بخش الگو کامل" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 242ed665..38cd36e1 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -286,6 +286,8 @@ [pages.xray] "title" = "Xray Настройки" +"save" = "Сохранить настройки" +"restart" = "Перезапустить рентген" "basicTemplate" = "Базовый шаблон" "advancedTemplate" = "Расширенный шаблон" "completeTemplate" = "Полный шаблон" diff --git a/web/translation/translate.vi_VN.toml b/web/translation/translate.vi_VN.toml index 27b0cca7..4aa12d8a 100644 --- a/web/translation/translate.vi_VN.toml +++ b/web/translation/translate.vi_VN.toml @@ -288,6 +288,8 @@ [pages.xray] "title" = "Xray Cài đặt" +"save" = "Lưu cài đặt" +"restart" = "Khởi động lại Xray" "basicTemplate" = "Mẫu Cơ bản" "advancedTemplate" = "Mẫu Nâng cao" "completeTemplate" = "Mẫu Đầy đủ" diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index d982b939..da250997 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -287,6 +287,8 @@ [pages.xray] "title" = "Xray 设置" +"save" = "保存设置" +"restart" = "重新启动 Xray" "basicTemplate" = "基本模板" "advancedTemplate" = "高级模板部件" "completeTemplate" = "Xray 配置的完整模板"