diff --git a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx index ff4119e3..5b5069d4 100644 --- a/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx +++ b/frontend/src/pages/Deploy/Deployment/List/components/DeploymentConfigModal.tsx @@ -56,10 +56,13 @@ interface EnvVariable { interface FormValues { applicationId?: number; externalSystemId?: number; - viewId?: number; - jobId?: number; - envs: EnvVariable[]; + jenkinsViewId?: number; + jenkinsJobId?: number; script: string; + envs: { + key: string; + value: string; + }[]; } interface DeploymentConfigModalProps { @@ -80,10 +83,10 @@ const DeploymentConfigModal: React.FC = ({open, onCa defaultValues: { applicationId: undefined, externalSystemId: undefined, - viewId: undefined, - jobId: undefined, - envs: [{key: '', value: ''}], + jenkinsViewId: undefined, + jenkinsJobId: undefined, script: '', + envs: [], } }); @@ -108,8 +111,8 @@ const DeploymentConfigModal: React.FC = ({open, onCa // 当选择外部系统时获取 View 列表 const handleExternalSystemChange = async (externalSystemId: number) => { form.setValue('externalSystemId', externalSystemId); - form.setValue('viewId', undefined); - form.setValue('jobId', undefined); + form.setValue('jenkinsViewId', undefined); + form.setValue('jenkinsJobId', undefined); setJenkinsJobs([]); if (externalSystemId) { @@ -122,8 +125,8 @@ const DeploymentConfigModal: React.FC = ({open, onCa // 当选择 View 时获取 Job 列表 const handleViewChange = async (viewId: number) => { - form.setValue('viewId', viewId); - form.setValue('jobId', undefined); + form.setValue('jenkinsViewId', viewId); + form.setValue('jenkinsJobId', undefined); const externalSystemId = form.getValues('externalSystemId'); if (externalSystemId && viewId) { @@ -144,39 +147,42 @@ const DeploymentConfigModal: React.FC = ({open, onCa return ( <> !open && onCancel()}> - - + + 部署配置
- - -
+ + +
( - 应用选择 + 应用名称 - + )} /> @@ -187,93 +193,94 @@ const DeploymentConfigModal: React.FC = ({open, onCa 三方系统 - + )} />
- - -
( - Jenkins视图选择 + Jenkins视图配置 - + )} /> ( - Jenkins任务选择 + Jenkins任务配置 - + )} />
- +
-
+
环境变量
@@ -297,7 +304,7 @@ const DeploymentConfigModal: React.FC = ({open, onCa - + )} /> @@ -309,7 +316,7 @@ const DeploymentConfigModal: React.FC = ({open, onCa - + )} /> @@ -320,7 +327,7 @@ const DeploymentConfigModal: React.FC = ({open, onCa onClick={() => remove(index)} className="mt-2" > - +
))} @@ -328,9 +335,9 @@ const DeploymentConfigModal: React.FC = ({open, onCa
- + -
+
= ({open, onCa
-
- - - - +
+ +