From b2afa65cb1269c911e3caf8ba16a5b18c5d0a884 Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 4 Jul 2022 22:44:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E8=84=9A=E6=9C=AC=E6=94=AF=E6=8C=81=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/crontab/detail.tsx | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/pages/crontab/detail.tsx b/src/pages/crontab/detail.tsx index 5dabea76..1625fb9b 100644 --- a/src/pages/crontab/detail.tsx +++ b/src/pages/crontab/detail.tsx @@ -20,6 +20,7 @@ import { FileOutlined, PlayCircleOutlined, PauseCircleOutlined, + FullscreenOutlined, } from '@ant-design/icons'; import { CrontabStatus } from './index'; import { diffTime } from '@/utils/date'; @@ -106,7 +107,8 @@ const CronDetailModal = ({ glyphMargin: false, wordWrap: 'on', }} - onMount={(editor) => { + onMount={(editor, monaco) => { + console.log(monaco); editorRef.current = editor; }} /> @@ -352,6 +354,11 @@ const CronDetailModal = ({ }); }; + const fullscreen = () => { + const editorElement = editorRef.current._domElement as HTMLElement; + editorElement.parentElement?.requestFullscreen(); + }; + useEffect(() => { if (cron && cron.id) { setCurrentCron(cron); @@ -529,13 +536,20 @@ const CronDetailModal = ({ }} tabBarExtraContent={ activeTabKey === 'script' && ( - + <> + +