mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
feat: lite mode settings
This commit is contained in:
@@ -191,6 +191,12 @@ pub struct IVerge {
|
||||
|
||||
/// 轻量模式 - 只保留内核运行
|
||||
pub enable_lite_mode: Option<bool>,
|
||||
|
||||
/// 自动进入轻量模式
|
||||
pub auto_enter_lite_mode: Option<bool>,
|
||||
|
||||
/// 自动进入轻量模式的延迟(分钟)
|
||||
pub auto_enter_lite_mode_delay: Option<u16>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||
@@ -294,6 +300,8 @@ impl IVerge {
|
||||
enable_tray_speed: Some(true),
|
||||
enable_global_hotkey: Some(true),
|
||||
enable_lite_mode: Some(false),
|
||||
auto_enter_lite_mode: Some(false),
|
||||
auto_enter_lite_mode_delay: Some(10),
|
||||
enable_dns_settings: Some(true),
|
||||
home_cards: None,
|
||||
..Self::default()
|
||||
@@ -378,6 +386,8 @@ impl IVerge {
|
||||
patch!(webdav_password);
|
||||
patch!(enable_tray_speed);
|
||||
patch!(enable_lite_mode);
|
||||
patch!(auto_enter_lite_mode);
|
||||
patch!(auto_enter_lite_mode_delay);
|
||||
patch!(enable_dns_settings);
|
||||
patch!(home_cards);
|
||||
}
|
||||
@@ -469,6 +479,8 @@ pub struct IVergeResponse {
|
||||
pub webdav_password: Option<String>,
|
||||
pub enable_tray_speed: Option<bool>,
|
||||
pub enable_lite_mode: Option<bool>,
|
||||
pub auto_enter_lite_mode: Option<bool>,
|
||||
pub auto_enter_lite_mode_delay: Option<u16>,
|
||||
pub enable_dns_settings: Option<bool>,
|
||||
pub home_cards: Option<serde_json::Value>,
|
||||
}
|
||||
@@ -534,6 +546,8 @@ impl From<IVerge> for IVergeResponse {
|
||||
webdav_password: verge.webdav_password,
|
||||
enable_tray_speed: verge.enable_tray_speed,
|
||||
enable_lite_mode: verge.enable_lite_mode,
|
||||
auto_enter_lite_mode: verge.auto_enter_lite_mode,
|
||||
auto_enter_lite_mode_delay: verge.auto_enter_lite_mode_delay,
|
||||
enable_dns_settings: verge.enable_dns_settings,
|
||||
home_cards: verge.home_cards,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user