feat: Cronjob reports add an unexecuted status (#10866)

Refs #10861
This commit is contained in:
ssongliu 2025-11-05 15:30:25 +08:00 committed by GitHub
parent cfe9e94e16
commit 6296aa04c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 20 additions and 3 deletions

View file

@ -173,7 +173,7 @@ func (u *CronjobRepo) AddFailedRecord(cronjobID uint, message string) {
var record model.JobRecords
record.StartTime = time.Now()
record.CronjobID = cronjobID
record.Status = constant.StatusFailed
record.Status = constant.StatusUnexecuted
record.Message = message
if err := global.DB.Create(&record).Error; err != nil {
global.LOG.Errorf("create record status failed, err: %v", err)

View file

@ -36,6 +36,7 @@ const (
StatusInstallErr = "InstallErr"
StatusUninstalling = "Uninstalling"
StatusWaitingRestart = "WaitingRestart"
StatusUnexecuted = "Unexecuted"
OrderDesc = "descending"
OrderAsc = "ascending"

View file

@ -80,6 +80,7 @@ const getType = (status: string) => {
case 'conflict':
return 'warning';
case 'duplicate':
case 'unexecuted':
return 'info';
default:
return 'primary';

View file

@ -344,6 +344,7 @@ const message = {
new: 'New',
conflict: 'Conflict',
duplicate: 'Duplicate',
unexecuted: 'Unexecuted',
},
units: {
second: ' second | second | seconds',

View file

@ -351,6 +351,7 @@ const message = {
new: 'Nuevo',
conflict: 'Conflicto',
duplicate: 'Duplicado',
unexecuted: 'No Ejecutado',
},
units: {
second: ' segundo | segundo | segundos',

View file

@ -333,6 +333,7 @@ const message = {
new: '新規',
conflict: '競合',
duplicate: '重複',
unexecuted: '未実行',
},
units: {
second: '2番目|2番目|',

View file

@ -335,6 +335,7 @@ const message = {
new: '신규',
conflict: '충돌',
duplicate: '중복',
unexecuted: '실행되지 않음',
},
units: {
second: ' | | ',

View file

@ -341,6 +341,7 @@ const message = {
new: 'Baru',
conflict: 'Konflik',
duplicate: 'Pendua',
unexecuted: 'Tidak Dilaksanakan',
},
units: {
second: 'saat | saat | saat',

View file

@ -339,6 +339,7 @@ const message = {
new: 'Novo',
conflict: 'Conflito',
duplicate: 'Duplicado',
unexecuted: 'Não Executado',
},
units: {
second: 'segundo | segundos | segundos',

View file

@ -336,6 +336,7 @@ const message = {
new: 'Новый',
conflict: 'Конфликт',
duplicate: 'Дубликат',
unexecuted: 'Не Выполнено',
},
units: {
second: ' секунда | секунда | секунд',

View file

@ -348,6 +348,7 @@ const message = {
new: 'Yeni',
conflict: 'Çakışma',
duplicate: 'Yinelenen',
unexecuted: 'Yürütülmedi',
},
units: {
second: ' saniye | saniye | saniye',

View file

@ -332,6 +332,7 @@ const message = {
new: '新',
conflict: '衝突',
duplicate: '重複',
unexecuted: '未執行',
},
units: {
second: '秒',

View file

@ -332,6 +332,7 @@ const message = {
new: '新',
conflict: '冲突',
duplicate: '重复',
unexecuted: '未执行',
},
units: {
second: '秒',

View file

@ -141,6 +141,7 @@
<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'" :loading="true" link type="info" />
<el-button v-if="row.lastRecordStatus === 'Unexecuted'" icon="Minus" link type="info" />
{{ row.lastRecordTime }}
</template>
</el-table-column>

View file

@ -81,6 +81,7 @@
<el-option :label="$t('commons.table.all')" value="" />
<el-option :label="$t('commons.status.success')" value="Success" />
<el-option :label="$t('commons.status.waiting')" value="Waiting" />
<el-option :label="$t('commons.status.unexecuted')" value="Unexecuted" />
<el-option :label="$t('commons.status.failed')" value="Failed" />
</el-select>
<TableRefresh @search="search(false)" />
@ -100,7 +101,7 @@
<el-table-column min-width="230px">
<template #default="{ row }">
<span v-if="row.id === currentRecord.id" class="select-sign"></span>
<Status class="mr-2 ml-1 float-left" :status="row.status" />
<Status class="mr-2 ml-1 float-left w-20" :status="row.status" />
<div class="mt-0.5">
<span>
{{ row.startTime }}
@ -182,7 +183,10 @@
<el-button
class="mt-0.5"
type="danger"
v-if="currentRecord?.status === 'Failed'"
v-if="
currentRecord?.status === 'Failed' ||
currentRecord?.status === 'Unexecuted'
"
icon="Warning"
link
/>