fix: 解决快照列表排序的问题 (#6816)

Refs #6810
This commit is contained in:
ssongliu 2024-10-23 10:46:17 +08:00 committed by GitHub
parent df5b69756c
commit f93cf3b996
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 3 deletions

View file

@ -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"`

View file

@ -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

View file

@ -135,7 +135,7 @@ export namespace Setting {
description: string;
status: string;
message: string;
createdAt: DateTimeFormats;
created_at: DateTimeFormats;
version: string;
interruptStep: string;
recoverStatus: string;

View file

@ -110,7 +110,7 @@
</template>
</el-table-column>
<el-table-column
prop="createdAt"
prop="created_at"
sortable
:label="$t('commons.table.date')"
:formatter="dateFormat"