From 656900d1db69d3a72fb82fd3d1aca11dd20e2c68 Mon Sep 17 00:00:00 2001 From: dengqichen Date: Fri, 6 Dec 2024 12:58:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=89=88=E8=A7=A3=E6=9E=90=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Workflow/Definition/Designer/index.tsx | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Workflow/Definition/Designer/index.tsx b/frontend/src/pages/Workflow/Definition/Designer/index.tsx index 224695e1..de7f1207 100644 --- a/frontend/src/pages/Workflow/Definition/Designer/index.tsx +++ b/frontend/src/pages/Workflow/Definition/Designer/index.tsx @@ -26,6 +26,11 @@ interface NodeData { description?: string; config: { executor?: string; + retryTimes?: number; + retryInterval?: number; + script?: string; + timeout?: number; + workingDir?: string; [key: string]: any; }; } @@ -259,13 +264,27 @@ const FlowDesigner: React.FC = () => { const nodeType = nodeTypes.find(type => type.code === data.type); if (nodeType) { setCurrentNodeType(nodeType); - // 设置表单值,包括基本信息和配置信息 - form.setFieldsValue({ + + // 合并节点基本配置和执行器配置 + const formValues = { name: data.name || nodeType.name, description: data.description, executor: data.config?.executor, - ...data.config - }); + retryTimes: data.config?.retryTimes, + retryInterval: data.config?.retryInterval, + }; + + // 如果是Shell节点,添加执行器特定配置 + if (data.type === 'SHELL' && data.config?.executor === 'SHELL') { + Object.assign(formValues, { + script: data.config?.script || '', + timeout: data.config?.timeout || 300, + workingDir: data.config?.workingDir || '/tmp' + }); + } + + // 设置表单值 + form.setFieldsValue(formValues); setConfigVisible(true); } else { message.error('未找到对应的节点类型');