diff --git a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx index 7cec4c1b..89d6c642 100644 --- a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx @@ -1,5 +1,5 @@ import React, {useEffect, useState, useCallback} from 'react'; -import {Modal, Form, Select, message, Switch, InputNumber, Input} from 'antd'; +import {Modal, Form, Select, message, Switch, InputNumber, Input, Space, Button} from 'antd'; import type {DeploymentConfig, DeployConfigTemplate, CreateDeploymentConfigRequest} from '../types'; import {createDeploymentConfig, updateDeploymentConfig, getDeployConfigTemplates} from '../service'; import {getApplicationList} from '../../../Application/List/service'; @@ -9,6 +9,7 @@ import {convertJsonSchemaToColumns} from '@/utils/jsonSchemaUtils'; import './styles.less'; import {Editor} from '@/components/Editor'; import type {JsonNode} from '@/types/common'; +import {FullscreenOutlined} from '@ant-design/icons'; const {Option} = Select; @@ -33,8 +34,16 @@ const DeploymentConfigModal: React.FC = ({ const [selectedTemplate, setSelectedTemplate] = useState(); const [buildVariables, setBuildVariables] = useState({}); const [loading, setLoading] = useState(false); + const [fullscreenStates, setFullscreenStates] = useState>({}); const isEdit = !!initialValues?.id; + const toggleFullscreen = (key: string) => { + setFullscreenStates(prev => ({ + ...prev, + [key]: !prev[key] + })); + }; + // 获取应用列表 const fetchApplications = useCallback(async () => { try { @@ -170,56 +179,102 @@ const DeploymentConfigModal: React.FC = ({ if (!selectedTemplate?.buildVariablesSchema?.properties) return null; const { properties } = selectedTemplate.buildVariablesSchema; - + return ( <> - {/* 遍历所有字段,对有 editorConfig 的字段使用富文本编辑器 */} - {Object.entries(properties).map(([key, property]) => ( - property.editorConfig ? ( - - handleEditorChange(key, value)} - options={{ - minimap: { enabled: property.editorConfig.minimap ?? false }, - fontSize: property.editorConfig.fontSize || 14, - lineNumbers: property.editorConfig.lineNumbers ? 'on' : 'off', - wordWrap: property.editorConfig.wordWrap ? 'on' : 'off', - tabSize: property.editorConfig.tabSize || 2, - scrollBeyondLastLine: false, - automaticLayout: true, - folding: property.editorConfig.folding ?? true, - autoClosingBrackets: 'always', - autoClosingQuotes: 'always', - formatOnPaste: true, - formatOnType: true, - suggestOnTriggerCharacters: property.editorConfig.autoComplete ?? true, - renderWhitespace: 'boundary', - }} - loading={ -
- 编辑器加载中... -
+ {Object.entries(properties).map(([key, property]) => { + if (property.editorConfig) { + return ( + + {property.title || key} +