mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-04 07:17:35 +08:00
任务详情编辑脚本支持全屏
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
|||||||
FileOutlined,
|
FileOutlined,
|
||||||
PlayCircleOutlined,
|
PlayCircleOutlined,
|
||||||
PauseCircleOutlined,
|
PauseCircleOutlined,
|
||||||
|
FullscreenOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { CrontabStatus } from './index';
|
import { CrontabStatus } from './index';
|
||||||
import { diffTime } from '@/utils/date';
|
import { diffTime } from '@/utils/date';
|
||||||
@@ -106,7 +107,8 @@ const CronDetailModal = ({
|
|||||||
glyphMargin: false,
|
glyphMargin: false,
|
||||||
wordWrap: 'on',
|
wordWrap: 'on',
|
||||||
}}
|
}}
|
||||||
onMount={(editor) => {
|
onMount={(editor, monaco) => {
|
||||||
|
console.log(monaco);
|
||||||
editorRef.current = editor;
|
editorRef.current = editor;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -352,6 +354,11 @@ const CronDetailModal = ({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const fullscreen = () => {
|
||||||
|
const editorElement = editorRef.current._domElement as HTMLElement;
|
||||||
|
editorElement.parentElement?.requestFullscreen();
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (cron && cron.id) {
|
if (cron && cron.id) {
|
||||||
setCurrentCron(cron);
|
setCurrentCron(cron);
|
||||||
@@ -529,6 +536,7 @@ const CronDetailModal = ({
|
|||||||
}}
|
}}
|
||||||
tabBarExtraContent={
|
tabBarExtraContent={
|
||||||
activeTabKey === 'script' && (
|
activeTabKey === 'script' && (
|
||||||
|
<>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
style={{ marginRight: 8 }}
|
style={{ marginRight: 8 }}
|
||||||
@@ -536,6 +544,12 @@ const CronDetailModal = ({
|
|||||||
>
|
>
|
||||||
保存
|
保存
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<FullscreenOutlined />}
|
||||||
|
onClick={fullscreen}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user