diff --git a/UPDATELOG.md b/UPDATELOG.md index a871d3df..ed808260 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -51,6 +51,7 @@ - 使用操作系统默认的窗口管理器 - 切换、升级、重启内核的状态管理 - 增加了一键随机API端口和密钥/单独刷新按钮 + - 更精细化控制自动日志清理,新增1天选项。 #### 优化了: - 系统代理 Bypass 设置 diff --git a/src-tauri/src/config/verge.rs b/src-tauri/src/config/verge.rs index 1018d7ec..6c31622c 100644 --- a/src-tauri/src/config/verge.rs +++ b/src-tauri/src/config/verge.rs @@ -134,7 +134,7 @@ pub struct IVerge { pub test_list: Option>, /// 日志清理 - /// 0: 不清理; 1: 7天; 2: 30天; 3: 90天 + /// 0: 不清理; 1: 1天;2: 7天; 3: 30天; 4: 90天 pub auto_log_clean: Option, /// 是否启用随机端口 diff --git a/src-tauri/src/core/handle.rs b/src-tauri/src/core/handle.rs index 807b2080..0ab9faee 100644 --- a/src-tauri/src/core/handle.rs +++ b/src-tauri/src/core/handle.rs @@ -317,9 +317,13 @@ impl Handle { let system_opt = handle.notification_system.read(); if let Some(system) = system_opt.as_ref() { - system.send_event(FrontendEvent::ProfileChanged { current_profile_id: profile_id }); + system.send_event(FrontendEvent::ProfileChanged { + current_profile_id: profile_id, + }); } else { - log::warn!("Notification system not initialized when trying to send ProfileChanged event."); + log::warn!( + "Notification system not initialized when trying to send ProfileChanged event." + ); } } @@ -333,7 +337,9 @@ impl Handle { if let Some(system) = system_opt.as_ref() { system.send_event(FrontendEvent::TimerUpdated { profile_index }); } else { - log::warn!("Notification system not initialized when trying to send TimerUpdated event."); + log::warn!( + "Notification system not initialized when trying to send TimerUpdated event." + ); } } @@ -347,7 +353,9 @@ impl Handle { if let Some(system) = system_opt.as_ref() { system.send_event(FrontendEvent::StartupCompleted); } else { - log::warn!("Notification system not initialized when trying to send StartupCompleted event."); + log::warn!( + "Notification system not initialized when trying to send StartupCompleted event." + ); } } diff --git a/src/components/setting/mods/misc-viewer.tsx b/src/components/setting/mods/misc-viewer.tsx index d7b88a93..33bfe39c 100644 --- a/src/components/setting/mods/misc-viewer.tsx +++ b/src/components/setting/mods/misc-viewer.tsx @@ -187,9 +187,10 @@ export const MiscViewer = forwardRef((props, ref) => { > {[ { key: t("Never Clean"), value: 0 }, - { key: t("Retain _n Days", { n: 7 }), value: 1 }, - { key: t("Retain _n Days", { n: 30 }), value: 2 }, - { key: t("Retain _n Days", { n: 90 }), value: 3 }, + { key: t("Retain _n Days", { n: 1 }), value: 1 }, + { key: t("Retain _n Days", { n: 7 }), value: 2 }, + { key: t("Retain _n Days", { n: 30 }), value: 3 }, + { key: t("Retain _n Days", { n: 90 }), value: 4 }, ].map((i) => ( {i.key} diff --git a/src/services/types.d.ts b/src/services/types.d.ts index 5b9999e4..913e8664 100644 --- a/src/services/types.d.ts +++ b/src/services/types.d.ts @@ -785,7 +785,7 @@ interface IVergeConfig { default_latency_test?: string; default_latency_timeout?: number; enable_builtin_enhanced?: boolean; - auto_log_clean?: 0 | 1 | 2 | 3; + auto_log_clean?: 0 | 1 | 2 | 3 | 4; proxy_layout_column?: number; test_list?: IVergeTestItem[]; webdav_url?: string;