feat: 计划任务列表增加上次执行状态 (#6722)

Refs #6212 #6197
pull/6732/head
ssongliu 1 month ago committed by GitHub
parent 86bf7ea73a
commit c8971dd0ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -115,6 +115,7 @@ type CronjobInfo struct {
DownloadAccountID uint `json:"downloadAccountID"`
RetainCopies int `json:"retainCopies"`
LastRecordStatus string `json:"lastRecordStatus"`
LastRecordTime string `json:"lastRecordTime"`
Status string `json:"status"`
Secret string `json:"secret"`

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

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

@ -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: '',

@ -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: '',

@ -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];
},
},
];

@ -105,6 +105,9 @@
</el-table-column>
<el-table-column :label="$t('cronjob.lastRecordTime')" :min-width="120" prop="lastRecordTime">
<template #default="{ row }">
<el-button v-if="row.lastRecordStatus === 'Success'" icon="Select" link type="success" />
<el-button v-if="row.lastRecordStatus === 'Failed'" icon="CloseBold" link type="danger" />
<el-button v-if="row.lastRecordStatus === 'Waiting'" icon="SemiSelect" link type="info" />
{{ row.lastRecordTime }}
</template>
</el-table-column>

Loading…
Cancel
Save