Restart xray in xray page #656

This commit is contained in:
Alireza Ahmadi
2023-12-01 21:21:33 +01:00
parent 3ec5ca3e8f
commit cbc4c144f2
5 changed files with 12 additions and 14 deletions

View File

@@ -72,8 +72,8 @@
<a-row>
<a-col :xs="24" :sm="8" style="padding: 4px;">
<a-space direction="horizontal">
<a-button type="primary" :disabled="saveBtnDisable" @click="updateXraySetting">{{ i18n "pages.settings.save" }}</a-button>
<a-button type="danger" :disabled="!saveBtnDisable" @click="restartPanel">{{ i18n "pages.settings.restartPanel" }}</a-button>
<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-space>
</a-col>
<a-col :xs="24" :sm="16">
@@ -564,19 +564,9 @@
await this.getXraySetting();
}
},
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(),
});
});
async restartXray() {
this.loading(true);
const msg = await HttpUtil.post("/xui/setting/restartPanel");
const msg = await HttpUtil.post("server/restartXrayService");
this.loading(false);
},
async resetXrayConfigToDefault() {

View File

@@ -292,6 +292,8 @@
[pages.xray]
"title" = "Xray Settings"
"save" = "Save Settings"
"restart" = "Reastart Xray"
"basicTemplate" = "Basic Template"
"advancedTemplate" = "Advanced Template"
"generalConfigs" = "General Configs"

View File

@@ -291,6 +291,8 @@
[pages.xray]
"title" = "تنظیمات Xray"
"save" = "ذخیره تنظیمات"
"restart" = "ریستارت ایکس‌ری"
"basicTemplate" = "بخش الگو پایه"
"advancedTemplate" = "بخش الگو پیشرفته"
"generalConfigs" = "تنظیمات عمومی"

View File

@@ -292,6 +292,8 @@
[pages.xray]
"title" = "Xray Настройки"
"save" = "Сохранить настройки"
"restart" = "Перезапустить рентген"
"basicTemplate" = "Базовые шаблоны"
"advancedTemplate" = "Расширенные шаблоны"
"generalConfigs" = "Основные настройки"

View File

@@ -292,6 +292,8 @@
[pages.xray]
"title" = "Xray 设置"
"save" = "保存设置"
"restart" = "重新启动 Xray"
"basicTemplate" = "基本模板"
"advancedTemplate" = "高级模板部件"
"generalConfigs" = "通用配置"