diff --git a/src/pages/crontab/index.less b/src/pages/crontab/index.less index 0fc9239a..77a979ca 100644 --- a/src/pages/crontab/index.less +++ b/src/pages/crontab/index.less @@ -2,12 +2,6 @@ margin-bottom: 0 !important; } -.cron { - &:hover { - cursor: pointer; - } -} - .crontab-detail { .card-wrapper { height: 80vh; diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 9188b5f5..38083ae5 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -93,10 +93,11 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { <> { - goToScriptManager(record); + setDetailCron(record); + setIsDetailModalVisible(true); }} > - {record.labels?.length > 0 && record.labels[0] !== '' ? ( + {record.labels?.length > 0 && record.labels[0] !== '' && false ? ( { onClick={(e) => { e.stopPropagation(); setSearchValue(`label:${label}`); + setSearchText(`label:${label}`); }} > {label} @@ -140,7 +142,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { title: '命令', dataIndex: 'command', key: 'command', - width: 250, + width: 300, align: 'center' as const, render: (text: string, record: any) => { return ( @@ -152,7 +154,13 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { }} ellipsis={{ tooltip: text, rows: 2 }} > - {text} + { + goToScriptManager(record); + }} + > + {text} + ); }, @@ -189,10 +197,10 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { > {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:') : '-'} ); @@ -396,9 +404,8 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { const { page, size, sorter } = pageConf; let url = `${config.apiPrefix}crons?searchValue=${searchText}&page=${page}&size=${size}`; if (sorter && sorter.field) { - url += `&sortField=${sorter.field}&sortType=${ - sorter.order === 'ascend' ? 'ASC' : 'DESC' - }`; + url += `&sortField=${sorter.field}&sortType=${sorter.order === 'ascend' ? 'ASC' : 'DESC' + }`; } if (viewConf) { url += `&queryString=${JSON.stringify({ @@ -562,8 +569,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { onOk() { request .put( - `${config.apiPrefix}crons/${ - record.isDisabled === 1 ? 'enable' : 'disable' + `${config.apiPrefix}crons/${record.isDisabled === 1 ? 'enable' : 'disable' }`, { data: [record.id], @@ -608,8 +614,7 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { onOk() { request .put( - `${config.apiPrefix}crons/${ - record.isPinned === 1 ? 'unpin' : 'pin' + `${config.apiPrefix}crons/${record.isPinned === 1 ? 'unpin' : 'pin' }`, { data: [record.id], @@ -931,14 +936,6 @@ const Crontab = ({ headerStyle, isPhone, theme }: any) => { (a, b) => a - b, ), }} - onRow={(record) => { - return { - onClick: (event) => { - setDetailCron(record); - setIsDetailModalVisible(true); - }, - }; - }} dataSource={value} rowKey="id" size="middle"