feat: enhance auto log cleaning options with 1-day retention and update related configurations

This commit is contained in:
Tunglies
2025-05-20 22:33:46 +08:00
Unverified
parent 7cd1816866
commit 4024b72954
5 changed files with 19 additions and 9 deletions

View File

@@ -51,6 +51,7 @@
- 使用操作系统默认的窗口管理器
- 切换、升级、重启内核的状态管理
- 增加了一键随机API端口和密钥/单独刷新按钮
- 更精细化控制自动日志清理新增1天选项。
#### 优化了:
- 系统代理 Bypass 设置

View File

@@ -134,7 +134,7 @@ pub struct IVerge {
pub test_list: Option<Vec<IVergeTestItem>>,
/// 日志清理
/// 0: 不清理; 1: 7天; 2: 30天; 3: 90天
/// 0: 不清理; 1: 1天2: 7天; 3: 30天; 4: 90天
pub auto_log_clean: Option<i32>,
/// 是否启用随机端口

View File

@@ -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."
);
}
}

View File

@@ -187,9 +187,10 @@ export const MiscViewer = forwardRef<DialogRef>((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) => (
<MenuItem key={i.value} value={i.value}>
{i.key}

View File

@@ -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;