()
| 23 | const Col = Grid.Col |
| 24 | |
| 25 | function Task_page() { |
| 26 | const { t } = useTranslation() |
| 27 | const navigate = useNavigate() |
| 28 | const [, forceUpdate] = useReducer(x => x + 1, 0) //刷新组件 |
| 29 | const [modal, contextHolder] = Modal.useModal() |
| 30 | |
| 31 | const columns: TableColumnProps[] = [ |
| 32 | { |
| 33 | title: t('task_name'), |
| 34 | dataIndex: 'name', |
| 35 | width: '20%', |
| 36 | ellipsis: true, |
| 37 | }, |
| 38 | { |
| 39 | title: t('state'), |
| 40 | dataIndex: 'state', |
| 41 | width: '5rem', |
| 42 | }, |
| 43 | { |
| 44 | title: t('cycle'), |
| 45 | dataIndex: 'cycle', |
| 46 | width: '5rem', |
| 47 | }, |
| 48 | { |
| 49 | title: t('run_info'), |
| 50 | dataIndex: 'runInfo', |
| 51 | ellipsis: true, |
| 52 | }, |
| 53 | { |
| 54 | title: t('actions'), |
| 55 | dataIndex: 'actions', |
| 56 | align: 'right', |
| 57 | width: '14rem', |
| 58 | }, |
| 59 | ] |
| 60 | console.log(nmConfig.task) |
| 61 | |
| 62 | return ( |
| 63 | <div style={{ width: '100%', height: '100%' }}> |
| 64 | {contextHolder} |
| 65 | <Row style={{ width: '100%', height: '2rem' }}> |
| 66 | <Col flex={'auto'}> |
| 67 | <Space> |
| 68 | <Button |
| 69 | type="primary" |
| 70 | onClick={() => { |
| 71 | navigate('/task/add') |
| 72 | }} |
| 73 | > |
| 74 | {t('add')} |
| 75 | </Button> |
| 76 | <Button |
| 77 | onClick={() => { |
| 78 | forceUpdate() |
| 79 | }} |
| 80 | > |
| 81 | {t('refresh')} |
| 82 | </Button> |
nothing calls this directly
no test coverage detected