feat(log): 实现日志文件持久化和全局进度条

- 新增日志文件保存和加载功能
- 实现全局进度条组件
- 优化初始化界面布局
- 更新设置界面,增加系统日志查看按钮
This commit is contained in:
2025-08-07 00:51:29 +08:00
parent ae151a9311
commit 161dc478ae
8 changed files with 212 additions and 43 deletions

View File

@@ -19,6 +19,10 @@ contextBridge.exposeInMainWorld('electronAPI', {
updateBackend: (repoUrl?: string) => ipcRenderer.invoke('update-backend', repoUrl),
startBackend: () => ipcRenderer.invoke('start-backend'),
// 日志文件操作
saveLogsToFile: (logs: string) => ipcRenderer.invoke('save-logs-to-file', logs),
loadLogsFromFile: () => ipcRenderer.invoke('load-logs-from-file'),
// 监听下载进度
onDownloadProgress: (callback: (progress: any) => void) => {
ipcRenderer.on('download-progress', (_, progress) => callback(progress))