From 6136f1206bee871e7607f0f90425bf51cfa68cfc Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 22 Feb 2024 00:19:45 +0800 Subject: [PATCH] feat: add reset button --- src-tauri/src/config/clash.rs | 2 +- src-tauri/src/core/sysopt.rs | 3 -- src/components/proxy/provider-button.tsx | 1 + src/components/rule/provider-button.tsx | 1 + src/components/setting/mods/tun-viewer.tsx | 53 +++++++++++++++++++--- src/locales/zh.json | 1 + 6 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src-tauri/src/config/clash.rs b/src-tauri/src/config/clash.rs index 0338828e..f0c16e57 100644 --- a/src-tauri/src/config/clash.rs +++ b/src-tauri/src/config/clash.rs @@ -32,7 +32,7 @@ impl IClashTemp { pub fn template() -> Self { let mut map = Mapping::new(); let mut tun = Mapping::new(); - tun.insert("stack".into(), "gVisor".into()); + tun.insert("stack".into(), "gvisor".into()); tun.insert("device".into(), "Meta".into()); tun.insert("auto-route".into(), true.into()); tun.insert("strict-route".into(), false.into()); diff --git a/src-tauri/src/core/sysopt.rs b/src-tauri/src/core/sysopt.rs index ea86256e..cb3e2dbe 100644 --- a/src-tauri/src/core/sysopt.rs +++ b/src-tauri/src/core/sysopt.rs @@ -148,9 +148,6 @@ impl Sysopt { /// init the auto launch pub fn init_launch(&self) -> Result<()> { - let enable = { Config::verge().latest().enable_auto_launch }; - let enable = enable.unwrap_or(false); - let app_exe = current_exe()?; let app_exe = dunce::canonicalize(app_exe)?; let app_name = app_exe diff --git a/src/components/proxy/provider-button.tsx b/src/components/proxy/provider-button.tsx index 8fa054de..0f14b7eb 100644 --- a/src/components/proxy/provider-button.tsx +++ b/src/components/proxy/provider-button.tsx @@ -55,6 +55,7 @@ export const ProviderButton = () => { {t("Proxy Provider")} + + } contentSx={{ width: 450 }} okBtn={t("Save")} cancelBtn={t("Cancel")} diff --git a/src/locales/zh.json b/src/locales/zh.json index cb5c0326..6d54ba86 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -167,6 +167,7 @@ "Auto Detect Interface": "自动选择流量出口接口", "DNS Hijack": "DNS 劫持", "MTU": "最大传输单元", + "Reset to Default": "重置为默认值", "Portable Updater Error": "便携版不支持应用内更新,请手动下载替换", "Tun Mode Info Windows": "Tun模式需要授予内核相关权限,使用前请先开启服务模式",