diff --git a/backend/app/dto/setting.go b/backend/app/dto/setting.go index 423e84c57..78e0ffef1 100644 --- a/backend/app/dto/setting.go +++ b/backend/app/dto/setting.go @@ -149,7 +149,7 @@ type SnapshotInfo struct { DefaultDownload string `json:"defaultDownload"` Status string `json:"status"` Message string `json:"message"` - CreatedAt time.Time `json:"createdAt"` + CreatedAt time.Time `json:"created_at"` Version string `json:"version"` InterruptStep string `json:"interruptStep"` diff --git a/backend/app/service/cronjob_backup.go b/backend/app/service/cronjob_backup.go index c3e2c77df..4ecdefb8a 100644 --- a/backend/app/service/cronjob_backup.go +++ b/backend/app/service/cronjob_backup.go @@ -1,6 +1,7 @@ package service import ( + "errors" "fmt" "os" "path" @@ -30,6 +31,9 @@ func (u *CronjobService) handleApp(cronjob model.Cronjob, startTime time.Time) e if err != nil { return err } + if len(appItems) == 0 { + return errors.New("no such app in database!") + } apps = appItems } accountMap, err := loadClientMap(cronjob.BackupAccounts) @@ -65,6 +69,9 @@ func (u *CronjobService) handleApp(cronjob model.Cronjob, startTime time.Time) e func (u *CronjobService) handleWebsite(cronjob model.Cronjob, startTime time.Time) error { webs := loadWebsForJob(cronjob) + if len(webs) == 0 { + return errors.New("no such website in database!") + } accountMap, err := loadClientMap(cronjob.BackupAccounts) if err != nil { return err @@ -98,6 +105,9 @@ func (u *CronjobService) handleWebsite(cronjob model.Cronjob, startTime time.Tim func (u *CronjobService) handleDatabase(cronjob model.Cronjob, startTime time.Time) error { dbs := loadDbsForJob(cronjob) + if len(dbs) == 0 { + return errors.New("no such db in database!") + } accountMap, err := loadClientMap(cronjob.BackupAccounts) if err != nil { return err diff --git a/frontend/src/api/interface/setting.ts b/frontend/src/api/interface/setting.ts index 1dc0da83c..a85dfe0d2 100644 --- a/frontend/src/api/interface/setting.ts +++ b/frontend/src/api/interface/setting.ts @@ -135,7 +135,7 @@ export namespace Setting { description: string; status: string; message: string; - createdAt: DateTimeFormats; + created_at: DateTimeFormats; version: string; interruptStep: string; recoverStatus: string; diff --git a/frontend/src/views/setting/snapshot/index.vue b/frontend/src/views/setting/snapshot/index.vue index ec017cc26..f7e2d16d8 100644 --- a/frontend/src/views/setting/snapshot/index.vue +++ b/frontend/src/views/setting/snapshot/index.vue @@ -110,7 +110,7 @@