From 5168b044a3f0823dd46c33285fafbd9ce691adc9 Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 20 Sep 2022 01:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=81=8D=E5=8E=86key?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/tag.tsx | 1 + src/pages/crontab/detail.tsx | 2 +- src/pages/crontab/index.tsx | 36 ++++++++++++++++-------------- src/pages/initialization/index.tsx | 1 + 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/components/tag.tsx b/src/components/tag.tsx index c62066fb..8c87e210 100644 --- a/src/components/tag.tsx +++ b/src/components/tag.tsx @@ -50,6 +50,7 @@ const EditableTagGroup = ({ {tag} ); + return ( {tagElem} diff --git a/src/pages/crontab/detail.tsx b/src/pages/crontab/detail.tsx index df9da0ed..d2aad83e 100644 --- a/src/pages/crontab/detail.tsx +++ b/src/pages/crontab/detail.tsx @@ -382,7 +382,7 @@ const CronDetailModal = ({ {currentCron.labels?.length > 0 && currentCron.labels[0] !== '' && currentCron.labels?.map((label: string, i: number) => ( - + {label} ))} diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index f53bc60b..956e3ba9 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -108,6 +108,7 @@ const Crontab = () => { {record.labels?.map((label: string) => ( { e.stopPropagation(); @@ -201,10 +202,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,10 +414,11 @@ 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, @@ -585,7 +587,8 @@ const Crontab = () => { onOk() { request .put( - `${config.apiPrefix}crons/${record.isDisabled === 1 ? 'enable' : 'disable' + `${config.apiPrefix}crons/${ + record.isDisabled === 1 ? 'enable' : 'disable' }`, { data: [record.id], @@ -630,7 +633,8 @@ const Crontab = () => { onOk() { request .put( - `${config.apiPrefix}crons/${record.isPinned === 1 ? 'unpin' : 'pin' + `${config.apiPrefix}crons/${ + record.isPinned === 1 ? 'unpin' : 'pin' }`, { data: [record.id], @@ -1090,13 +1094,11 @@ const Crontab = () => { label: '全部任务', children: panelContent, }, - ...[...enabledCronViews].slice(0, 2).map((x) => ( - { - key: x.id, - label: x.name, - children: panelContent - } - )), + ...[...enabledCronViews].slice(0, 2).map((x) => ({ + key: x.id, + label: x.name, + children: panelContent, + })), ]} > diff --git a/src/pages/initialization/index.tsx b/src/pages/initialization/index.tsx index 87916ba1..23caa9e0 100644 --- a/src/pages/initialization/index.tsx +++ b/src/pages/initialization/index.tsx @@ -124,6 +124,7 @@ const Initialization = () => { {fields.map((x) => (