定时任务支持任务名,定时,命令排序

环境变量支持名称排序
This commit is contained in:
hanhh 2021-08-19 14:45:42 +08:00
parent 5e13264393
commit a48b915675
2 changed files with 13 additions and 0 deletions

View File

@ -69,6 +69,10 @@ const Crontab = () => {
render: (text: string, record: any) => ( render: (text: string, record: any) => (
<span>{record.name || record._id}</span> <span>{record.name || record._id}</span>
), ),
sorter: {
compare: (a: any, b: any) => a.name.localeCompare(b.name),
multiple: 2,
},
}, },
{ {
title: '任务', title: '任务',
@ -90,12 +94,20 @@ const Crontab = () => {
</span> </span>
); );
}, },
sorter: {
compare: (a: any, b: any) => a.command.localeCompare(b.command),
multiple: 3,
},
}, },
{ {
title: '任务定时', title: '任务定时',
dataIndex: 'schedule', dataIndex: 'schedule',
key: 'schedule', key: 'schedule',
align: 'center' as const, align: 'center' as const,
sorter: {
compare: (a: any, b: any) => a.schedule.localeCompare(b.schedule),
multiple: 1,
},
}, },
{ {
title: '状态', title: '状态',

View File

@ -119,6 +119,7 @@ const Env = () => {
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
align: 'center' as const, align: 'center' as const,
sorter: (a: any, b: any) => a.name.localeCompare(b.name),
}, },
{ {
title: '值', title: '值',