Unverified Commit 6bfe4663 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Fix-2898] fix finishtime render error (#2923)

* fix-finishtime-error * Spotless Apply --------- Co-authored-by: 's avatarZzm0809 <Zzm0809@users.noreply.github.com>
parent bb6c1b83
...@@ -21,7 +21,7 @@ import StatusTag from '@/components/JobTags/StatusTag'; ...@@ -21,7 +21,7 @@ import StatusTag from '@/components/JobTags/StatusTag';
import { getJobDuration } from '@/pages/DevOps/function'; import { getJobDuration } from '@/pages/DevOps/function';
import { queryList } from '@/services/api'; import { queryList } from '@/services/api';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { Jobs } from '@/types/DevOps/data'; import { Jobs } from '@/types/DevOps/data.d';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import type { ActionType, ProColumns } from '@ant-design/pro-components'; import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components';
...@@ -46,14 +46,19 @@ const JobHistoryList = (props: HistoryProps) => { ...@@ -46,14 +46,19 @@ const JobHistoryList = (props: HistoryProps) => {
valueType: 'dateTime' valueType: 'dateTime'
}, },
{ {
title: l('global.table.endTime'), title: l('global.table.finishTime'),
dataIndex: 'finishTime', render(_, row: Jobs.JobInstance) {
valueType: 'dateTime' // 判断finishTime 是否 小于 1970-01-02 如果是则返回 '-' 否则返回 finishTime
return !row.finishTime || new Date(row.finishTime) <= new Date('1970-01-02')
? '-'
: row.finishTime;
}
}, },
{ {
title: l('global.table.jobid'), title: l('global.table.jobid'),
dataIndex: 'jid', dataIndex: 'jid',
key: 'jid' key: 'jid',
copyable: true
}, },
{ {
title: l('global.table.status'), title: l('global.table.status'),
......
...@@ -37,7 +37,7 @@ declare namespace Jobs { ...@@ -37,7 +37,7 @@ declare namespace Jobs {
error: string; error: string;
failedRestartCount: number; failedRestartCount: number;
duration: number; duration: number;
finishTime: Date; finishTime: string;
}; };
export type JobConfig = { export type JobConfig = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment