Skip to content

Commit

Permalink
定时任务,环境变量添加状态筛选
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanhh committed Aug 20, 2021
1 parent 0d59618 commit 77d4840
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/pages/crontab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,31 @@ const Crontab = ({ headerStyle, isPhone }: any) => {
dataIndex: 'status',
align: 'center' as const,
width: 60,
filters: [
{
text: '运行中',
value: 0,
},
{
text: '空闲中',
value: 1,
},
{
text: '已禁用',
value: 2,
},
{
text: '队列中',
value: 3,
},
],
onFilter: (value: number, record: any) => {
if (record.isDisabled && record.status !== 0) {
return value === 2;
} else {
return record.status === value;
}
},
render: (text: string, record: any) => (
<>
{(!record.isDisabled || record.status !== CrontabStatus.idle) && (
Expand Down
11 changes: 11 additions & 0 deletions src/pages/env/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ const Env = ({ headerStyle, isPhone, theme }: any) => {
dataIndex: 'status',
align: 'center' as const,
width: 60,
filters: [
{
text: '已启用',
value: 0,
},
{
text: '已禁用',
value: 1,
},
],
onFilter: (value: number, record: any) => record.status === value,
render: (text: string, record: any, index: number) => {
return (
<Space size="middle" style={{ cursor: 'text' }}>
Expand Down

0 comments on commit 77d4840

Please sign in to comment.