Unverified Commit e5070787 authored by Licho's avatar Licho Committed by GitHub

refactor: dinky-web job list component (#2082)

* refactor: package uri wrong, and trivial optimization * refactor: convert to enum * Spotless Apply --------- Co-authored-by: 's avatarleechor <leechor@users.noreply.github.com>
parent 2f4cc1c0
......@@ -19,7 +19,7 @@ const JobHistoryList = (props: HistoryProps) => {
const actionRef = useRef<ActionType>();
const jobListColums: ProColumns<Jobs.JobInstance>[] = [
const jobListColumns: ProColumns<Jobs.JobInstance>[] = [
{
title: l('global.table.createTime'),
......@@ -59,7 +59,7 @@ const JobHistoryList = (props: HistoryProps) => {
params={{isHistory: true}}
tableStyle={{overflowX: "hidden", overflowY: "hidden", margin: "10px"}}
size={"small"}
columns={jobListColums}
columns={jobListColumns}
actionRef={actionRef}
request={(params) => queryList(API_CONSTANTS.GET_JOB_LIST, {
...params,
......
......@@ -17,26 +17,26 @@
export const JOB_LIFE_CYCLE = {
UNKNOWN: 0,
CREATE: 1,
DEVELOP: 2,
DEBUG: 3,
RELEASE: 4,
ONLINE: 5,
CANCEL: 6,
};
export enum JOB_LIFE_CYCLE {
UNKNOWN = 0,
CREATE = 1,
DEVELOP = 2,
DEBUG = 3,
RELEASE = 4,
ONLINE = 5,
CANCEL = 6,
}
export const JOB_STATUS = {
FINISHED: 'FINISHED',
RUNNING: 'RUNNING',
FAILED: 'FAILED',
CANCELED: 'CANCELED',
INITIALIZING: 'INITIALIZING',
RESTARTING: 'RESTARTING',
CREATED: 'CREATED',
FAILING: 'FAILING',
SUSPENDED: 'SUSPENDED',
CANCELLING: 'CANCELLING',
UNKNOWN: 'UNKNOWN',
};
export enum JOB_STATUS {
FINISHED = 'FINISHED',
RUNNING = 'RUNNING',
FAILED = 'FAILED',
CANCELED = 'CANCELED',
INITIALIZING = 'INITIALIZING',
RESTARTING = 'RESTARTING',
CREATED = 'CREATED',
FAILING = 'FAILING',
SUSPENDED = 'SUSPENDED',
CANCELLING = 'CANCELLING',
UNKNOWN = 'UNKNOWN',
}
......@@ -14,7 +14,7 @@ import {JOB_STATUS_FILTER, LIFECYCLE_FILTER, TagJobLifeCycle, TagJobStatus} from
const JobList = () => {
const tableRef = useRef<ActionType>();
const jobListColums: ProColumns<Jobs.JobInstance>[] = [
const jobListColumns: ProColumns<Jobs.JobInstance>[] = [
{
title: l('global.table.taskid'),
dataIndex: 'taskId',
......@@ -80,7 +80,7 @@ const JobList = () => {
return (
<ProTable<Jobs.JobInstance>
rowKey={(record => record.jid)}
columns={jobListColums}
columns={jobListColumns}
params={{isHistory: false}}
actionRef={tableRef}
headerTitle={l('devops.joblist.joblist')}
......@@ -91,8 +91,8 @@ const JobList = () => {
})}
expandable={{
expandedRowRender: (record) => <JobHistoryList taskId={record.taskId} key={record.jid}/>,
expandIcon: ({expanded, onExpand, record}) => {
return (
expandIcon: ({expanded, onExpand, record}) =>
(
<Button
className={'options-button'}
key={`${record.id}_history`}
......@@ -100,8 +100,7 @@ const JobList = () => {
title={l('devops.joblist.history')}
icon={<ClockCircleTwoTone twoToneColor={expanded ? '#52c41a' : '#4096ff'}/>}
/>
);
}
)
}}
/>
);
......
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