diff --git a/src/pages/crontab/detail.tsx b/src/pages/crontab/detail.tsx index ce718297..706ebd4c 100644 --- a/src/pages/crontab/detail.tsx +++ b/src/pages/crontab/detail.tsx @@ -67,6 +67,7 @@ const CronDetailModal = ({ const editorRef = useRef(null); const [scriptInfo, setScriptInfo] = useState({}); const [logUrl, setLogUrl] = useState(''); + const [validTabs, setValidTabs] = useState(tabList); const contentList: any = { log: ( @@ -146,6 +147,8 @@ const CronDetailModal = ({ .then((data) => { setValue(data.data); }); + } else { + setValidTabs([validTabs[0]]); } }; @@ -204,7 +207,9 @@ const CronDetailModal = ({ title={ <> {cron.name} - + {cron.labels?.length > 0 && cron.labels[0] !== '' && ( + + )} {cron.labels?.length > 0 && cron.labels[0] !== '' && cron.labels?.map((label: string, i: number) => ( @@ -222,7 +227,7 @@ const CronDetailModal = ({ wrapClassName="crontab-detail" width={!isPhone ? '80vw' : ''} > -
+
任务
@@ -298,7 +303,7 @@ const CronDetailModal = ({ { onTabChange(key); @@ -314,7 +319,6 @@ const CronDetailModal = ({ ) } - bodyStyle={{ height: 'calc(80vh - 238px)', overflowY: 'auto' }} > {contentList[activeTabKey]} diff --git a/src/pages/crontab/index.less b/src/pages/crontab/index.less index 6ca67a55..44ffdf67 100644 --- a/src/pages/crontab/index.less +++ b/src/pages/crontab/index.less @@ -9,6 +9,19 @@ } .crontab-detail { + .card-wrapper { + height: 80vh; + height: calc(80vh - var(--vh-offset, 0px)); + + .ant-card:last-child { + .ant-card-body { + height: calc(80vh - 238px); + height: calc(80vh - var(--vh-offset, 0px) - 238px); + overflow-y: auto; + } + } + } + .ant-modal-body { background: #eee; padding: 12px;