add systray

This commit is contained in:
2026-02-07 17:57:48 +08:00
parent eb23ef9d5d
commit e76ada9b4b
17 changed files with 335 additions and 617 deletions

View File

@@ -9,16 +9,13 @@ import (
)
func (s *Service) SaveHistory() {
// 将 pending 状态的任务改为 canceled
transferList := s.GetTransferList()
for _, task := range transferList {
if task.Status == TransferStatusPending {
task.Status = TransferStatusCanceled
}
if !s.config.GetSaveHistory() {
return
}
transfers := s.GetTransferList()
configDir := config.GetConfigDir()
historyPath := filepath.Join(configDir, "history.json")
historyJson, err := json.Marshal(transferList)
historyJson, err := json.Marshal(transfers)
if err != nil {
return
}