From 54b57156f3b38678e13f863cf7e7ff590e8074d1 Mon Sep 17 00:00:00 2001 From: zhaowei Date: Sun, 27 Apr 2025 16:04:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BA=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=B7=BB=E5=8A=A0=E8=B5=84=E6=BA=90=E8=A7=84?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoML/components/AutoMLBasic/index.tsx | 5 +++ .../CreateForm/VideoExecuteConfig.tsx | 18 ++++++++++ .../ModelDeployment/CreateVersion/index.tsx | 35 ++++++++++++++++--- 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/react-ui/src/pages/AutoML/components/AutoMLBasic/index.tsx b/react-ui/src/pages/AutoML/components/AutoMLBasic/index.tsx index 19c4fee0..98a1f4ba 100644 --- a/react-ui/src/pages/AutoML/components/AutoMLBasic/index.tsx +++ b/react-ui/src/pages/AutoML/components/AutoMLBasic/index.tsx @@ -212,6 +212,11 @@ function AutoMLBasic({ info, className, runStatus, isInstance = false }: AutoMLB value: info.dataset, format: formatDataset, }, + { + label: '资源规格', + value: info.computing_resource_id, + format: getResourceDescription, + }, { label: '类别数量', value: info.num_classes, diff --git a/react-ui/src/pages/AutoML/components/CreateForm/VideoExecuteConfig.tsx b/react-ui/src/pages/AutoML/components/CreateForm/VideoExecuteConfig.tsx index 425de115..6e739251 100644 --- a/react-ui/src/pages/AutoML/components/CreateForm/VideoExecuteConfig.tsx +++ b/react-ui/src/pages/AutoML/components/CreateForm/VideoExecuteConfig.tsx @@ -1,3 +1,4 @@ +import ParameterSelect from '@/components/ParameterSelect'; import ResourceSelect, { ResourceSelectorType, requiredValidator, @@ -36,6 +37,23 @@ function VideoExecuteConfig() { + + + + + + + + { + if (!value) { + return Promise.reject(new Error('请输入变量名')); + } + if (!/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(value)) { + return Promise.reject( + new Error( + '变量名只支持字母、数字、下划线、中横线并且必须以字母或下划线开头', + ), + ); + } + // 判断不能重名 + const list = form + .getFieldValue('env_variables') + .filter( + (item: FormEnvVariable | undefined) => + item !== undefined && item !== null, + ); + + const names = list.map((item: FormEnvVariable) => item.key); + if (new Set(names).size !== names.length) { + return Promise.reject(new Error('名称不能重复')); + } + return Promise.resolve(); + }, }, ]} >