From 0d9eba4b6e82ee9eb0d593f6f0abd3cbdf471d80 Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 26 Oct 2024 14:49:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=A4=96?= =?UTF-8?q?=E6=BC=8F=E6=A0=87=E7=AD=BE=E6=94=B9=E4=B8=BA=2010=20=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/crontab/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/crontab/index.tsx b/src/pages/crontab/index.tsx index 71af9445..c2405987 100644 --- a/src/pages/crontab/index.tsx +++ b/src/pages/crontab/index.tsx @@ -62,6 +62,7 @@ import { noop, omit } from 'lodash'; const { Text, Paragraph, Link } = Typography; const { Search } = Input; +const SHOW_TAB_COUNT = 10; const Crontab = () => { const { headerStyle, isPhone, theme } = useOutletContext(); @@ -805,7 +806,7 @@ const Crontab = () => { useEffect(() => { if (viewConf && enabledCronViews && enabledCronViews.length > 0) { - const view = enabledCronViews.slice(4).find((x) => x.id === viewConf.id); + const view = enabledCronViews.slice(SHOW_TAB_COUNT).find((x) => x.id === viewConf.id); setMoreMenuActive(!!view); } }, [viewConf, enabledCronViews]); @@ -835,7 +836,7 @@ const Crontab = () => { viewAction(key); }, items: [ - ...[...enabledCronViews].slice(4).map((x) => ({ + ...[...enabledCronViews].slice(SHOW_TAB_COUNT).map((x) => ({ label: ( {x.name} @@ -955,7 +956,7 @@ const Crontab = () => { } onTabClick={tabClick} items={[ - ...[...enabledCronViews].slice(0, 4).map((x) => ({ + ...[...enabledCronViews].slice(0, SHOW_TAB_COUNT).map((x) => ({ key: x.id, label: x.name, })),