diff --git a/.env b/.env index 9b11972..60b3623 100644 --- a/.env +++ b/.env @@ -4,7 +4,7 @@ VITE_APP_TITLE=Snail Job VITE_APP_DESC=A flexible, reliable, and fast platform for distributed task retry and distributed task scheduling. -VITE_APP_VERSION=1.2.0-beta2 +VITE_APP_VERSION=1.2.0 VITE_APP_DEFAULT_TOKEN=SJ_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj diff --git a/src/components/common/job-task-list-table.vue b/src/components/common/job-task-list-table.vue index a52753b..1a66ea6 100644 --- a/src/components/common/job-task-list-table.vue +++ b/src/components/common/job-task-list-table.vue @@ -4,6 +4,7 @@ import { NButton, NCode, NTag } from 'naive-ui'; import hljs from 'highlight.js/lib/core'; import json from 'highlight.js/lib/languages/json'; import { ref, render } from 'vue'; +import dayjs from 'dayjs'; import { taskStatusRecord, taskStatusRecordOptions } from '@/constants/business'; import { $t } from '@/locales'; import { isNotNull, parseArgsJson, translateOptions } from '@/utils/common'; @@ -251,6 +252,18 @@ const { columns, searchParams, columnChecks, data, getData, loading, mobilePagin title: $t('page.jobBatch.jobTask.createDt'), align: 'left', minWidth: 130 + }, + { + key: 'duration', + title: $t('page.jobBatch.duration'), + align: 'center', + width: 120, + render: row => { + if (row.taskStatus === 3) { + return Math.round(dayjs(row.updateDt).diff(dayjs(row.createDt)) / 1000); + } + return null; + } } ] }); diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 8c5c14e..29f6ec7 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -125,7 +125,7 @@ declare namespace Api { interface LoginToken { id: string; mode: string; - role: String; + role: string; token: string; refreshToken: string; createDt: string; @@ -934,7 +934,7 @@ declare namespace Api { >; type ExportWorkflow = Common.CommonRecord<{ - workflowIds: String[]; + workflowIds: string[]; }> & WorkflowSearchParams; @@ -1072,6 +1072,8 @@ declare namespace Api { children: JobTaskTree[]; /** 是否存在下级 */ isLeaf: boolean; + /** 执行时长(virtual) */ + duration?: number; }>; type JobTaskTree = { diff --git a/src/views/group/modules/group-operate-drawer.vue b/src/views/group/modules/group-operate-drawer.vue index 4b6c085..662d698 100644 --- a/src/views/group/modules/group-operate-drawer.vue +++ b/src/views/group/modules/group-operate-drawer.vue @@ -1,5 +1,6 @@