From d073e50b0d2bf01fb0cae7ca1fba0ded4f7b6a35 Mon Sep 17 00:00:00 2001 From: powerAn <25736019+powerAn2020@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:25:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=A2=9E=E5=BC=BA&=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BF=BB=E8=AF=91=E6=96=87=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Dashboard.vue | 9 +++++++++ src/Setting.vue | 9 +++++++++ src/locales/en-US.js | 11 ++++++++++- src/locales/zh-CN.js | 10 +++++++++- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/Dashboard.vue b/src/Dashboard.vue index 26660bb..49a90fd 100644 --- a/src/Dashboard.vue +++ b/src/Dashboard.vue @@ -172,6 +172,15 @@ const execServiceCmd = (operation) => { disablePull.value = true setTimeout(() => { execXrayHelperCmd("service " + operation.value).then(value => { + if(operation.value=="start"||operation.value=="restart"){ + execXrayHelperCmd("proxy refresh").then(value2 => { + stdout.value=value+'\n'+value2; + }) + }else if (operation.value=="stop"){ + execXrayHelperCmd("proxy disable").then(value2 => { + stdout.value=value+'\n'+value2; + }) + } stdout.value = value }) }, 300) diff --git a/src/Setting.vue b/src/Setting.vue index b007170..190c70a 100644 --- a/src/Setting.vue +++ b/src/Setting.vue @@ -476,6 +476,15 @@ const getConfig = async () => { const saveConfig = () => { saveFile(YAML.stringify(config.value, {indent: 4}), XRAYHELPER_CONFIG) + setTimeout(() => { + callApi("get status").then(value => { + if (value.pid.length > 0) { + execXrayHelperCmd("proxy refresh").then(value2 => { + showToast(i18n.global.t('setting.refresh-proxy')) + }) + } + }) + }, 50) } const onRefresh = () => { setTimeout(() => { diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 59f0745..4826731 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -45,9 +45,16 @@ export const manage = { 'not-support': 'Not supporting the current core type.', 'no-more': 'No more.', 'route-manage': 'Routing', + 'more-setting': 'Settings', 'load-balancing': 'Balancer', 'speedtest': 'Speedtest', 'switch': 'Switch', + 'remarks': 'Remarks', + 'search': 'Querying', + 'placeholder-text': 'Please enter an Remarks.', + 'speedtest-fail': 'The speed measurement failed and an exception occurred.', + 'speedtest-reject': 'Wait patiently until the speed measurement of other nodes is completed before continuing.', + 'speedtest-all-warn': 'All nodes will be speed tested soon to prevent the airport from being blocked! Use with caution (ps: not recommended. Too many nodes will freeze the page, and starting multi-process speed testing will consume power). Confirm to continue?', } export const setting = { 'xrayhelper': 'Config - XrayHelper', @@ -90,5 +97,7 @@ export const setting = { 'cannot-get-config': 'Cannot get XrayHelper config', 'running-warn': 'Currently the core is running, it is highly recommended to stop it and disable proxy before edit', 'switch-core': 'Detected core switching. Whether to synchronously switch to the default configuration?', - 'core-not-found':'Detected that the current core does not exist. Do you want to start downloading now?' + 'core-not-found':'Detected that the current core does not exist. Do you want to start downloading now?', + 'refresh-proxy':'The configuration file has been reloaded.' + } \ No newline at end of file diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index d7e7a9f..9933d0c 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -45,9 +45,16 @@ export const manage = { 'not-support': '暂不支持当前核心', 'no-more': '没有更多了', 'route-manage': '路由规则', + 'more-setting': '更多设置', 'load-balancing': '负载均衡', 'speedtest': '测速', 'switch': '切换', + 'remarks': '别名', + 'search': '查询中', + 'placeholder-text': '请输入别名', + 'speedtest-fail': '测速失败,发生异常。', + 'speedtest-reject': '耐心等待其他节点测速结束后再继续。', + 'speedtest-all-warn': '即将测速所有节点,以防机场封号!谨慎使用(ps:不推荐,节点多页面会卡死,而且启动多进程测速会耗电),确认继续?', } export const setting = { 'xrayhelper': '配置项 - XrayHelper', @@ -90,5 +97,6 @@ export const setting = { 'cannot-get-config': '无法获取 XrayHelper 配置文件', 'running-warn': '当前核心正在运行,强烈建议停止核心并停用代理后再修改此页配置', 'switch-core': '检测到核心切换,是否同步切换为默认配置?', - 'core-not-found':'检测到当前核心不存在,是否现在开始下载?' + 'core-not-found':'检测到当前核心不存在,是否现在开始下载?', + 'refresh-proxy':'配置文件已经重新载入。' } \ No newline at end of file