feat: add Open Dashboard to the hotkey, close #723
This commit is contained in:
parent
f4c7b17a87
commit
3efd575dd2
@ -76,6 +76,7 @@ impl Hotkey {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let f = match func.trim() {
|
let f = match func.trim() {
|
||||||
|
"open_dashboard" => || feat::open_dashboard(),
|
||||||
"clash_mode_rule" => || feat::change_clash_mode("rule".into()),
|
"clash_mode_rule" => || feat::change_clash_mode("rule".into()),
|
||||||
"clash_mode_global" => || feat::change_clash_mode("global".into()),
|
"clash_mode_global" => || feat::change_clash_mode("global".into()),
|
||||||
"clash_mode_direct" => || feat::change_clash_mode("direct".into()),
|
"clash_mode_direct" => || feat::change_clash_mode("direct".into()),
|
||||||
|
@ -7,10 +7,20 @@
|
|||||||
use crate::config::*;
|
use crate::config::*;
|
||||||
use crate::core::*;
|
use crate::core::*;
|
||||||
use crate::log_err;
|
use crate::log_err;
|
||||||
|
use crate::utils::resolve;
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
use serde_yaml::{Mapping, Value};
|
use serde_yaml::{Mapping, Value};
|
||||||
use wry::application::clipboard::Clipboard;
|
use wry::application::clipboard::Clipboard;
|
||||||
|
|
||||||
|
// 打开面板
|
||||||
|
pub fn open_dashboard() {
|
||||||
|
let handle = handle::Handle::global();
|
||||||
|
let app_handle = handle.app_handle.lock();
|
||||||
|
if let Some(app_handle) = app_handle.as_ref() {
|
||||||
|
resolve::create_window(app_handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 重启clash
|
// 重启clash
|
||||||
pub fn restart_clash_core() {
|
pub fn restart_clash_core() {
|
||||||
tauri::async_runtime::spawn(async {
|
tauri::async_runtime::spawn(async {
|
||||||
|
@ -14,6 +14,7 @@ const ItemWrapper = styled("div")`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const HOTKEY_FUNC = [
|
const HOTKEY_FUNC = [
|
||||||
|
"open_dashboard",
|
||||||
"clash_mode_rule",
|
"clash_mode_rule",
|
||||||
"clash_mode_global",
|
"clash_mode_global",
|
||||||
"clash_mode_direct",
|
"clash_mode_direct",
|
||||||
|
@ -108,6 +108,7 @@
|
|||||||
"Download Speed": "Download Speed",
|
"Download Speed": "Download Speed",
|
||||||
"Upload Speed": "Upload Speed",
|
"Upload Speed": "Upload Speed",
|
||||||
|
|
||||||
|
"open_dashboard": "Open Dashboard",
|
||||||
"clash_mode_rule": "Rule Mode",
|
"clash_mode_rule": "Rule Mode",
|
||||||
"clash_mode_global": "Global Mode",
|
"clash_mode_global": "Global Mode",
|
||||||
"clash_mode_direct": "Direct Mode",
|
"clash_mode_direct": "Direct Mode",
|
||||||
|
@ -97,6 +97,7 @@
|
|||||||
"Save": "Сохранить",
|
"Save": "Сохранить",
|
||||||
"Cancel": "Отмена",
|
"Cancel": "Отмена",
|
||||||
|
|
||||||
|
"open_dashboard": "Open Dashboard",
|
||||||
"clash_mode_rule": "Режим правил",
|
"clash_mode_rule": "Режим правил",
|
||||||
"clash_mode_global": "Глобальный режим",
|
"clash_mode_global": "Глобальный режим",
|
||||||
"clash_mode_direct": "Прямой режим",
|
"clash_mode_direct": "Прямой режим",
|
||||||
|
@ -108,6 +108,7 @@
|
|||||||
"Download Speed": "下载速度",
|
"Download Speed": "下载速度",
|
||||||
"Upload Speed": "上传速度",
|
"Upload Speed": "上传速度",
|
||||||
|
|
||||||
|
"open_dashboard": "打开面板",
|
||||||
"clash_mode_rule": "规则模式",
|
"clash_mode_rule": "规则模式",
|
||||||
"clash_mode_global": "全局模式",
|
"clash_mode_global": "全局模式",
|
||||||
"clash_mode_direct": "直连模式",
|
"clash_mode_direct": "直连模式",
|
||||||
|
Loading…
Reference in New Issue
Block a user