From 22f85fb3ae2da410711d11edb9cc774971eeeb54 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Mon, 19 May 2025 11:04:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9E=E9=AA=8C=E5=8F=96=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E7=BA=BF=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/CreateForm/ExecuteConfig.tsx | 5 ++- .../components/AddModelModal/index.tsx | 4 +- react-ui/src/pages/Experiment/Info/index.jsx | 43 ++++++++++++++----- react-ui/src/pages/Mirror/Info/index.tsx | 1 + 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx b/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx index c548e079..a1a34c21 100644 --- a/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx +++ b/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx @@ -292,7 +292,7 @@ function ExecuteConfig() { @@ -419,6 +419,7 @@ function ExecuteConfig() { - + diff --git a/react-ui/src/pages/Dataset/components/AddModelModal/index.tsx b/react-ui/src/pages/Dataset/components/AddModelModal/index.tsx index 7cd6af7a..9e641699 100644 --- a/react-ui/src/pages/Dataset/components/AddModelModal/index.tsx +++ b/react-ui/src/pages/Dataset/components/AddModelModal/index.tsx @@ -126,7 +126,7 @@ function AddModelModal({ typeList, tagList, onOk, ...rest }: AddModelModalProps) { - const experimentNode = experimentStatusObjs?.[item.id]; - updateWorkflowNode(item, experimentNode); - }); + if (experimentStatusObjs) { + workflowData.nodes.forEach((item) => { + const experimentNode = experimentStatusObjs?.[item.id]; + updateWorkflowNode(item, experimentNode); + }); + + // 处理workflow状态 + Object.keys(experimentStatusObjs).some((key) => { + if (key.startsWith(NodePrefix)) { + const workflowStatus = experimentStatusObjs[key]; + setWorkflowStatus(workflowStatus); + return true; + } + return false; + }); + } // 绘制图 getGraphData(workflowData, true); @@ -147,6 +161,15 @@ function ExperimentText() { status: phase, })); + const workflowStatus = Object.values(nodes).find((node) => + node.displayName.startsWith(NodePrefix), + ); + + // 设置工作流状态 + if (workflowStatus) { + setWorkflowStatus(workflowStatus); + } + const workflowData = workflowRef.current; workflowData.nodes.forEach((item) => { const experimentNode = Object.values(nodes).find((node) => node.displayName === item.id); @@ -471,13 +494,13 @@ function ExperimentText() {
- 启动时间:{formatDate(experimentIns?.create_time)} + 启动时间:{formatDate(workflowStatus?.startedAt)}
执行时长:
@@ -488,11 +511,11 @@ function ExperimentText() { height: '8px', borderRadius: '50%', marginRight: '6px', - backgroundColor: experimentStatusInfo[experimentIns?.status]?.color, + backgroundColor: experimentStatusInfo[workflowStatus?.phase]?.color, }} >
- - {experimentStatusInfo[experimentIns?.status]?.label} + + {experimentStatusInfo[workflowStatus?.phase]?.label}