chore: Remove unnecessary hotkey

This commit is contained in:
MystiPanda 2024-02-27 11:18:52 +08:00
parent faf61b4af3
commit 0f48873c25
No known key found for this signature in database
GPG Key ID: 47D0F0284DC57888
6 changed files with 6 additions and 91 deletions

View File

@ -69,13 +69,8 @@ impl Hotkey {
"clash_mode_rule" => || feat::change_clash_mode("rule".into()),
"clash_mode_global" => || feat::change_clash_mode("global".into()),
"clash_mode_direct" => || feat::change_clash_mode("direct".into()),
"clash_mode_script" => || feat::change_clash_mode("script".into()),
"toggle_system_proxy" => feat::toggle_system_proxy,
"enable_system_proxy" => feat::enable_system_proxy,
"disable_system_proxy" => feat::disable_system_proxy,
"toggle_tun_mode" => feat::toggle_tun_mode,
"enable_tun_mode" => feat::enable_tun_mode,
"disable_tun_mode" => feat::disable_tun_mode,
_ => bail!("invalid function \"{func}\""),
};

View File

@ -84,36 +84,6 @@ pub fn toggle_system_proxy() {
});
}
// 打开系统代理
pub fn enable_system_proxy() {
tauri::async_runtime::spawn(async {
match patch_verge(IVerge {
enable_system_proxy: Some(true),
..IVerge::default()
})
.await
{
Ok(_) => handle::Handle::refresh_verge(),
Err(err) => log::error!(target: "app", "{err}"),
}
});
}
// 关闭系统代理
pub fn disable_system_proxy() {
tauri::async_runtime::spawn(async {
match patch_verge(IVerge {
enable_system_proxy: Some(false),
..IVerge::default()
})
.await
{
Ok(_) => handle::Handle::refresh_verge(),
Err(err) => log::error!(target: "app", "{err}"),
}
});
}
// 切换tun模式
pub fn toggle_tun_mode() {
let enable = Config::verge().data().enable_tun_mode;
@ -132,36 +102,6 @@ pub fn toggle_tun_mode() {
});
}
// 打开tun模式
pub fn enable_tun_mode() {
tauri::async_runtime::spawn(async {
match patch_verge(IVerge {
enable_tun_mode: Some(true),
..IVerge::default()
})
.await
{
Ok(_) => handle::Handle::refresh_verge(),
Err(err) => log::error!(target: "app", "{err}"),
}
});
}
// 关闭tun模式
pub fn disable_tun_mode() {
tauri::async_runtime::spawn(async {
match patch_verge(IVerge {
enable_tun_mode: Some(false),
..IVerge::default()
})
.await
{
Ok(_) => handle::Handle::refresh_verge(),
Err(err) => log::error!(target: "app", "{err}"),
}
});
}
/// 修改clash的订阅
pub async fn patch_clash(patch: Mapping) -> Result<()> {
Config::clash().draft().patch_config(patch.clone());

View File

@ -18,13 +18,8 @@ const HOTKEY_FUNC = [
"clash_mode_rule",
"clash_mode_global",
"clash_mode_direct",
"clash_mode_script",
"toggle_system_proxy",
"enable_system_proxy",
"disable_system_proxy",
"toggle_tun_mode",
"enable_tun_mode",
"disable_tun_mode",
];
export const HotkeyViewer = forwardRef<DialogRef>((props, ref) => {

View File

@ -143,13 +143,8 @@
"clash_mode_rule": "Rule Mode",
"clash_mode_global": "Global Mode",
"clash_mode_direct": "Direct Mode",
"clash_mode_script": "Script Mode",
"toggle_system_proxy": "Toggle System Proxy",
"enable_system_proxy": "Enable System Proxy",
"disable_system_proxy": "Disable System Proxy",
"toggle_tun_mode": "Toggle Tun Mode",
"enable_tun_mode": "Enable Tun Mode",
"disable_tun_mode": "Disable Tun Mode",
"toggle_system_proxy": "Enable/Disable System Proxy",
"toggle_tun_mode": "Enable/Disable Tun Mode",
"App Log Level": "App Log Level",
"Auto Close Connections": "Auto Close Connections",

View File

@ -125,13 +125,8 @@
"clash_mode_rule": "Режим правил",
"clash_mode_global": "Глобальный режим",
"clash_mode_direct": "Прямой режим",
"clash_mode_script": "Скриптовый режим",
"toggle_system_proxy": "Переключить режим системного прокси",
"enable_system_proxy": "Включить системный прокси",
"disable_system_proxy": "Отключить системный прокси",
"toggle_tun_mode": "Переключить режим туннеля",
"enable_tun_mode": "Включить режим туннеля",
"disable_tun_mode": "Отключить режим туннеля",
"toggle_system_proxy": "Включить/Отключить системный прокси",
"toggle_tun_mode": "Включить/Отключить режим туннеля",
"Portable Updater Error": "Портативная версия не поддерживает обновление внутри приложения, пожалуйста, скачайте и замените вручную"
}

View File

@ -143,13 +143,8 @@
"clash_mode_rule": "规则模式",
"clash_mode_global": "全局模式",
"clash_mode_direct": "直连模式",
"clash_mode_script": "脚本模式",
"toggle_system_proxy": "切换系统代理",
"enable_system_proxy": "开启系统代理",
"disable_system_proxy": "关闭系统代理",
"toggle_tun_mode": "切换Tun模式",
"enable_tun_mode": "开启Tun模式",
"disable_tun_mode": "关闭Tun模式",
"toggle_system_proxy": "打开/关闭系统代理",
"toggle_tun_mode": "打开/关闭Tun模式",
"App Log Level": "App日志等级",
"Auto Close Connections": "自动关闭连接",