From 767a2087322bdbe3af5c9a5c66a999cf17093823 Mon Sep 17 00:00:00 2001 From: zhaowei Date: Tue, 27 May 2025 09:45:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=EF=BC=9A=E5=B7=A5=E4=BD=9C=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E5=AE=9E=E9=AA=8C=E8=BF=90=E8=A1=8C=E6=97=B6=E9=95=BF?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/pages/Experiment/Info/index.jsx | 11 +-- .../ModelDeployment/CreateVersion/index.tsx | 2 +- .../components/ExperimentTable/index.tsx | 37 ++------- .../components/ExperimentTable/instance.tsx | 76 +++++++++++++++++++ 4 files changed, 91 insertions(+), 35 deletions(-) create mode 100644 react-ui/src/pages/Workspace/components/ExperimentTable/instance.tsx diff --git a/react-ui/src/pages/Experiment/Info/index.jsx b/react-ui/src/pages/Experiment/Info/index.jsx index 2ea0ccf1..1e96c34c 100644 --- a/react-ui/src/pages/Experiment/Info/index.jsx +++ b/react-ui/src/pages/Experiment/Info/index.jsx @@ -159,12 +159,13 @@ function ExperimentText() { return; } const { finishedAt, phase, nodes = {} } = statusData; + // 更新实验实例状态和结束时间 - setExperimentIns((prev) => ({ - ...prev, - finish_time: finishedAt, - status: phase, - })); + // setExperimentIns((prev) => ({ + // ...prev, + // finish_time: finishedAt, + // status: phase, + // })); // 设置总 workflow 状态 const tempWorkflowStatus = Object.values(nodes).find((node) => diff --git a/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx b/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx index 46d50b21..cd1992c2 100644 --- a/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx +++ b/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx @@ -238,7 +238,7 @@ function CreateServiceVersion() { }, { pattern: /^[a-zA-Z0-9._-]+$/, - message: '版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', + message: '服务支持字母、数字、点(.)、下划线(_)、中横线(-)', }, ]} > diff --git a/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx b/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx index c454d170..e8461f85 100644 --- a/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx +++ b/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx @@ -1,10 +1,9 @@ -import KFIcon from '@/components/KFIcon'; -import { ExperimentStatus, experimentStatusInfo } from '@/pages/Experiment/status'; import { ExperimentInstance } from '@/types'; -import { elapsedTime, formatDate } from '@/utils/date'; import { useNavigate } from '@umijs/max'; -import { Button, Empty } from 'antd'; +import { Empty } from 'antd'; import styles from './index.less'; +import ExperimentInstanceComponent from './instance'; + type ExperimentTableProps = { tableData: ExperimentInstance[]; style?: React.CSSProperties; @@ -26,31 +25,11 @@ function ExperimentTable({ tableData = [], style }: ExperimentTableProps) { {Array.isArray(tableData) && tableData.length > 0 ? ( tableData.map((item) => ( -
-
- -
-
- {elapsedTime(item.create_time, item.finish_time)} -
-
{formatDate(item.create_time)}
-
- -
-
+ gotoExperiment(item)} + /> )) ) : ( void; +}; + +function ExperimentInstanceComponent({ instance, onClick }: ExperimentInstanceComponentProps) { + const { experiment_id, id, argo_ins_name, argo_ins_ns, nodes_status } = instance; + const initialWorkflowStatus = getWorkflowStatus(nodes_status) as NodeStatus | undefined; + const [workflowStatus, setWorkflowStatus] = useState( + initialWorkflowStatus, + ); + const status = getExperimentInstanceStatus(instance.status as ExperimentStatus, workflowStatus); + const createTime = workflowStatus?.startedAt; + const finishTime = workflowStatus?.finishedAt; + const statusInfo = experimentStatusInfo[status]; + + const handleSSEMessage: MessageHandler = useCallback( + ( + _experimentId: number, + _experimentInsId: number, + _status: string, + _finishTime: string, + nodes, + ) => { + if (nodes) { + // 设置总 workflow 状态 + const workflowStatus = Object.values(nodes).find((node: any) => + node.displayName.startsWith(NodePrefix), + ) as NodeStatus; + if (workflowStatus) { + setWorkflowStatus(workflowStatus); + } + } + }, + [], + ); + useSSE(experiment_id, id, status, argo_ins_name, argo_ins_ns, handleSSEMessage); + + return ( +
+
+ +
+
+ +
+
{formatDate(createTime)}
+
+ +
+
+ ); +} + +export default ExperimentInstanceComponent; From 40ca029363f6db67858245d72a23e2f722a848de Mon Sep 17 00:00:00 2001 From: zhaowei Date: Tue, 27 May 2025 14:06:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=EF=BC=9A=E8=87=AA=E5=8A=A8=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E5=AD=A6=E4=B9=A0=E6=B7=BB=E5=8A=A0mlp=E7=AE=97?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/AutoML/components/CreateForm/ExecuteConfig.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx b/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx index 65ad4c8b..fded3102 100644 --- a/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx +++ b/react-ui/src/pages/AutoML/components/CreateForm/ExecuteConfig.tsx @@ -21,6 +21,7 @@ const classificationAlgorithms = [ 'lda', 'liblinear_svc', 'libsvm_svc', + 'tablenet', 'mlp', 'multinomial_nb', 'passive_aggressive', @@ -30,13 +31,7 @@ const classificationAlgorithms = [ 'LightGBMClassification', 'XGBoostClassification', 'StackingClassification', -].map((name) => { - if (name === 'mlp') { - return { label: 'tablenet', value: name }; - } else { - return { label: name, value: name }; - } -}); +].map((name) => ({ label: name, value: name })); // 回归算法 const regressorAlgorithms = [