feat(update-center): 实现集中式软件更新中心功能

新增更新中心模块,支持管理 APM 和传统 deb 软件更新任务
- 添加更新任务队列管理、状态跟踪和日志记录功能
- 实现更新项忽略配置持久化存储
- 新增更新确认对话框和迁移提示
- 优化主窗口关闭时的任务保护机制
- 添加单元测试覆盖核心逻辑
This commit is contained in:
2026-04-09 08:19:51 +08:00
parent 97bb8e5f59
commit 0b17ada45a
37 changed files with 6389 additions and 342 deletions

View File

@@ -0,0 +1,15 @@
export interface MainWindowCloseGuardState {
installTaskCount: number;
hasRunningUpdateCenterTasks: boolean;
}
export type MainWindowCloseAction = "hide" | "destroy";
export const shouldPreventMainWindowClose = (
state: MainWindowCloseGuardState,
): boolean => state.installTaskCount > 0 || state.hasRunningUpdateCenterTasks;
export const getMainWindowCloseAction = (
state: MainWindowCloseGuardState,
): MainWindowCloseAction =>
shouldPreventMainWindowClose(state) ? "hide" : "destroy";