refactor: do not trigger autobackup on profile change (#6464)

* refactor: do not trigger autobackup on profile change

* chore: i18n
This commit is contained in:
Slinetrac 2026-03-11 14:56:15 +08:00 committed by GitHub
parent 20a523b3d6
commit 7ebf27ba52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
27 changed files with 35 additions and 41 deletions

View File

@ -23,5 +23,6 @@
- 优化首次启动节点信息刷新
- Linux 默认使用内置窗口控件
- 实现排除自定义网段的校验
- 移除冗余的自动备份触发条件
</details>

View File

@ -12,7 +12,6 @@ use crate::{
},
core::{CoreManager, handle, timer::Timer, tray::Tray},
feat,
module::auto_backup::{AutoBackupManager, AutoBackupTrigger},
process::AsyncHandler,
utils::{dirs, help},
};
@ -108,7 +107,6 @@ pub async fn import_profile(url: std::string::String, option: Option<PrfOption>)
}
logging!(info, Type::Cmd, "[导入订阅] 导入完成: {}", help::mask_url(&url));
AutoBackupManager::trigger_backup(AutoBackupTrigger::ProfileChange);
Ok(())
}
@ -141,7 +139,6 @@ pub async fn create_profile(item: PrfItem, file_data: Option<String>) -> CmdResu
handle::Handle::notify_profile_changed(uid);
}
Config::profiles().await.apply();
AutoBackupManager::trigger_backup(AutoBackupTrigger::ProfileChange);
Ok(())
}
Err(err) => {
@ -184,7 +181,6 @@ pub async fn delete_profile(index: String) -> CmdResult {
// 发送配置变更通知
logging!(info, Type::Cmd, "[删除订阅] 发送配置变更通知: {}", index);
handle::Handle::notify_profile_changed(&index);
AutoBackupManager::trigger_backup(AutoBackupTrigger::ProfileChange);
}
Err(e) => {
logging!(error, Type::Cmd, "{}", e);
@ -438,7 +434,6 @@ pub async fn patch_profile(index: String, profile: PrfItem) -> CmdResult {
});
}
AutoBackupManager::trigger_backup(AutoBackupTrigger::ProfileChange);
Ok(())
}

View File

@ -21,7 +21,7 @@ pub async fn save_profile_file(index: String, file_data: Option<String>) -> CmdR
let backup_trigger = match index.as_str() {
"Merge" => Some(AutoBackupTrigger::GlobalMerge),
"Script" => Some(AutoBackupTrigger::GlobalScript),
_ => Some(AutoBackupTrigger::ProfileChange),
_ => None,
};
// 在异步操作前获取必要元数据并释放锁

View File

@ -34,7 +34,6 @@ pub enum AutoBackupTrigger {
Scheduled,
GlobalMerge,
GlobalScript,
ProfileChange,
}
impl AutoBackupTrigger {
@ -43,7 +42,6 @@ impl AutoBackupTrigger {
Self::Scheduled => "scheduled",
Self::GlobalMerge => "merge",
Self::GlobalScript => "script",
Self::ProfileChange => "profile",
}
}

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "Create local backups in the background at the configured interval.",
"intervalLabel": "Backup frequency",
"changeLabel": "Backup on critical changes",
"changeHelper": "Automatically back up when the global extend config/script or subscriptions are added, removed, or edited.",
"changeHelper": "Automatically backup when Global Extend Config/Script changes.",
"options": {
"hours": "Every {{n}} hours",
"days": "Every {{n}} days"

View File

@ -359,7 +359,7 @@
"scheduleHelper": "按设定频率在后台创建本地备份文件。",
"intervalLabel": "备份频率",
"changeLabel": "关键变更时自动备份",
"changeHelper": "全局扩展配置/脚本或订阅增删改后会自动备份。",
"changeHelper": "全局扩展覆写配置/脚本更改后自动备份。",
"options": {
"hours": "每 {{n}} 小时",
"days": "每 {{n}} 天"

View File

@ -72,8 +72,8 @@
},
"more": {
"global": {
"merge": "Global Merge",
"script": "Global Script"
"merge": "Global Extend Config",
"script": "Global Extend Script"
},
"chips": {
"merge": "Merge",

View File

@ -359,7 +359,7 @@
"scheduleHelper": "依設定頻率在背景建立本機備份檔案。",
"intervalLabel": "備份頻率",
"changeLabel": "關鍵變更時自動備份",
"changeHelper": "全域擴充配置/腳本或訂閱新增、刪除、修改時自動備份。",
"changeHelper": "Global Extend Config/Script 變更後自動備份。",
"options": {
"hours": "每 {{n}} 小時",
"days": "每 {{n}} 天"