diff --git a/agent/app/dto/cronjob.go b/agent/app/dto/cronjob.go index cdb859fae..38d9d1fc9 100644 --- a/agent/app/dto/cronjob.go +++ b/agent/app/dto/cronjob.go @@ -115,9 +115,10 @@ type CronjobInfo struct { DownloadAccountID uint `json:"downloadAccountID"` RetainCopies int `json:"retainCopies"` - LastRecordTime string `json:"lastRecordTime"` - Status string `json:"status"` - Secret string `json:"secret"` + LastRecordStatus string `json:"lastRecordStatus"` + LastRecordTime string `json:"lastRecordTime"` + Status string `json:"status"` + Secret string `json:"secret"` } type SearchRecord struct { diff --git a/agent/app/service/cronjob.go b/agent/app/service/cronjob.go index 9603fea32..dbda88b8a 100644 --- a/agent/app/service/cronjob.go +++ b/agent/app/service/cronjob.go @@ -50,6 +50,7 @@ func (u *CronjobService) SearchWithPage(search dto.PageCronjob) (int64, interfac } record, _ := cronjobRepo.RecordFirst(cronjob.ID) if record.ID != 0 { + item.LastRecordStatus = record.Status item.LastRecordTime = record.StartTime.Format(constant.DateTimeLayout) } else { item.LastRecordTime = "-" diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 4a8dce4d4..de43a8a30 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -873,7 +873,7 @@ const message = { website: 'Backup Website', rulesHelper: 'When there are multiple compression exclusion rules, they need to be displayed with line breaks. For example: \n*.log \n*.sql', - lastRecordTime: 'Last Execution Time', + lastRecordTime: 'Last Execution', all: 'All', failedRecord: 'Failed Records', successRecord: 'Successful Records', @@ -957,6 +957,8 @@ const message = { today: 'Today', yesterday: 'Yesterday', lastNDay: 'Last {0} day', + lastNMonth: 'Last {0} months', + lastHalfYear: 'Last half year', memory: 'Memory', cache: 'Cache', disk: 'Disk', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index 6aba0c741..eb51454a2 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -833,7 +833,7 @@ const message = { app: '備份應用', website: '備份網站', rulesHelper: '當存在多個壓縮排除規則時,需要換行顯示,例:\n*.log \n*.sql', - lastRecordTime: '上次執行時間', + lastRecordTime: '上次執行情況', database: '備份數據庫', missBackupAccount: '未能找到備份賬號', syncDate: '同步時間 ', @@ -912,6 +912,8 @@ const message = { today: '今天', yesterday: '昨天', lastNDay: '近 {0} 天', + lastNMonth: '近 {0} 月', + lastHalfYear: '近半年', memory: '內存', cache: '緩存', disk: '磁盤', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 190b64f49..27294fac8 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -834,7 +834,7 @@ const message = { app: '备份应用', website: '备份网站', rulesHelper: '当存在多个压缩排除规则时,需要换行显示,例:\n*.log \n*.sql', - lastRecordTime: '上次执行时间', + lastRecordTime: '上次执行情况', database: '备份数据库', missBackupAccount: '未能找到备份账号', syncDate: '同步时间 ', @@ -913,6 +913,8 @@ const message = { today: '今天', yesterday: '昨天', lastNDay: '近 {0} 天', + lastNMonth: '近 {0} 月', + lastHalfYear: '近半年', memory: '内存', cache: '缓存', disk: '磁盘', diff --git a/frontend/src/utils/shortcuts.ts b/frontend/src/utils/shortcuts.ts index a340955b7..498cb65e1 100644 --- a/frontend/src/utils/shortcuts.ts +++ b/frontend/src/utils/shortcuts.ts @@ -42,4 +42,22 @@ export const shortcuts = [ return [start, end]; }, }, + { + text: i18n.global.t('monitor.lastNMonth', [3]), + value: () => { + const end = new Date(); + const start = new Date(end); + start.setMonth(end.getMonth() - 3); + return [start, end]; + }, + }, + { + text: i18n.global.t('monitor.lastHalfYear', [30]), + value: () => { + const end = new Date(); + const start = new Date(end); + start.setMonth(end.getMonth() - 6); + return [start, end]; + }, + }, ]; diff --git a/frontend/src/views/cronjob/index.vue b/frontend/src/views/cronjob/index.vue index d5285f530..4a92ccf25 100644 --- a/frontend/src/views/cronjob/index.vue +++ b/frontend/src/views/cronjob/index.vue @@ -105,6 +105,9 @@