diff --git a/package.json b/package.json index 2c2da8c6..5b61dae9 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "@umijs/max": "^4.0.21", "@umijs/ssr-darkreader": "^4.9.45", "ansi-to-react": "^6.1.6", - "antd": "^4.20.5", + "antd": "^4.23.0", "antd-img-crop": "^4.2.3", "codemirror": "^5.65.2", "compression-webpack-plugin": "9.2.0", diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 80f905ba..f53bc60b 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -201,10 +201,10 @@ const Crontab = () => { > {record.last_execution_time ? new Date(record.last_execution_time * 1000) - .toLocaleString(language, { - hour12: false, - }) - .replace(' 24:', ' 00:') + .toLocaleString(language, { + hour12: false, + }) + .replace(' 24:', ' 00:') : '-'} ); @@ -413,11 +413,10 @@ const Crontab = () => { const getCrons = () => { setLoading(true); const { page, size, sorter, filters } = pageConf; - let url = `${ - config.apiPrefix - }crons?searchValue=${searchText}&page=${page}&size=${size}&filters=${JSON.stringify( - filters, - )}`; + let url = `${config.apiPrefix + }crons?searchValue=${searchText}&page=${page}&size=${size}&filters=${JSON.stringify( + filters, + )}`; if (sorter && sorter.field) { url += `&sorter=${JSON.stringify({ field: sorter.field, @@ -586,8 +585,7 @@ const Crontab = () => { onOk() { request .put( - `${config.apiPrefix}crons/${ - record.isDisabled === 1 ? 'enable' : 'disable' + `${config.apiPrefix}crons/${record.isDisabled === 1 ? 'enable' : 'disable' }`, { data: [record.id], @@ -632,8 +630,7 @@ const Crontab = () => { onOk() { request .put( - `${config.apiPrefix}crons/${ - record.isPinned === 1 ? 'unpin' : 'pin' + `${config.apiPrefix}crons/${record.isPinned === 1 ? 'unpin' : 'pin' }`, { data: [record.id], @@ -1087,6 +1084,20 @@ const Crontab = () => { } onTabClick={tabClick} + items={[ + { + key: 'all', + label: '全部任务', + children: panelContent, + }, + ...[...enabledCronViews].slice(0, 2).map((x) => ( + { + key: x.id, + label: x.name, + children: panelContent + } + )), + ]} > {panelContent}