mirror of
				https://github.com/whyour/qinglong.git
				synced 2025-11-01 01:16:07 +08:00 
			
		
		
		
	任务详情编辑脚本支持全屏
This commit is contained in:
		
							parent
							
								
									87a265191c
								
							
						
					
					
						commit
						a4a76ec235
					
				|  | @ -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' && ( | ||||
|               <Button | ||||
|                 type="primary" | ||||
|                 style={{ marginRight: 8 }} | ||||
|                 onClick={saveFile} | ||||
|               > | ||||
|                 保存 | ||||
|               </Button> | ||||
|               <> | ||||
|                 <Button | ||||
|                   type="primary" | ||||
|                   style={{ marginRight: 8 }} | ||||
|                   onClick={saveFile} | ||||
|                 > | ||||
|                   保存 | ||||
|                 </Button> | ||||
|                 <Button | ||||
|                   type="primary" | ||||
|                   icon={<FullscreenOutlined />} | ||||
|                   onClick={fullscreen} | ||||
|                 /> | ||||
|               </> | ||||
|             ) | ||||
|           } | ||||
|         > | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 whyour
						whyour