diff --git a/backend/app/dto/setting.go b/backend/app/dto/setting.go index 7be17a5d9..bab7242ce 100644 --- a/backend/app/dto/setting.go +++ b/backend/app/dto/setting.go @@ -115,14 +115,15 @@ type SnapshotImport struct { Description string `json:"description" validate:"max=256"` } type SnapshotInfo struct { - ID uint `json:"id"` - Name string `json:"name"` - Description string `json:"description" validate:"max=256"` - From string `json:"from"` - Status string `json:"status"` - Message string `json:"message"` - CreatedAt time.Time `json:"createdAt"` - Version string `json:"version"` + ID uint `json:"id"` + Name string `json:"name"` + Description string `json:"description" validate:"max=256"` + From string `json:"from"` + DefaultDownload string `json:"defaultDownload"` + Status string `json:"status"` + Message string `json:"message"` + CreatedAt time.Time `json:"createdAt"` + Version string `json:"version"` InterruptStep string `json:"interruptStep"` RecoverStatus string `json:"recoverStatus"` diff --git a/backend/app/service/cronjob_backup.go b/backend/app/service/cronjob_backup.go index 61fea19b6..1c56893f7 100644 --- a/backend/app/service/cronjob_backup.go +++ b/backend/app/service/cronjob_backup.go @@ -208,7 +208,8 @@ func (u *CronjobService) handleSnapshot(cronjob model.Cronjob, startTime time.Ti record.FileDir = "system_snapshot" req := dto.SnapshotCreate{ - From: record.BackupType, + From: record.BackupType, + DefaultDownload: cronjob.DefaultDownload, } name, err := NewISnapshotService().HandleSnapshot(true, logPath, req, startTime.Format("20060102150405")) if err != nil { diff --git a/backend/init/migration/migrations/v_1_9.go b/backend/init/migration/migrations/v_1_9.go index 65f70932e..5a767039e 100644 --- a/backend/init/migration/migrations/v_1_9.go +++ b/backend/init/migration/migrations/v_1_9.go @@ -281,7 +281,7 @@ var UpdateCronjobSpec = &gormigrate.Migration{ mapAccount[item.ID] = item.Type } for _, job := range jobs { - if job.KeepLocal { + if job.KeepLocal && mapAccount[uint(job.TargetDirID)] != constant.Local { if err := tx.Model(&model.Cronjob{}). Where("id = ?", job.ID). Updates(map[string]interface{}{ diff --git a/frontend/src/views/cronjob/index.vue b/frontend/src/views/cronjob/index.vue index 82c58875b..abee476a4 100644 --- a/frontend/src/views/cronjob/index.vue +++ b/frontend/src/views/cronjob/index.vue @@ -83,7 +83,7 @@