Skip to content

Commit

Permalink
fix: 解决快照列表排序的问题 (#6816)
Browse files Browse the repository at this point in the history
Refs #6810
  • Loading branch information
ssongliu committed Oct 24, 2024
1 parent 8a6ba5c commit 26b47ba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/app/dto/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
10 changes: 10 additions & 0 deletions backend/app/service/cronjob_backup.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package service

import (
"errors"
"fmt"
"os"
"path"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/interface/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export namespace Setting {
description: string;
status: string;
message: string;
createdAt: DateTimeFormats;
created_at: DateTimeFormats;
version: string;
interruptStep: string;
recoverStatus: string;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/setting/snapshot/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</template>
</el-table-column>
<el-table-column
prop="createdAt"
prop="created_at"
sortable
:label="$t('commons.table.date')"
:formatter="dateFormat"
Expand Down

0 comments on commit 26b47ba

Please sign in to comment.