From e59ff1eae3f35c33ab214466b63d42337d4ee3ee Mon Sep 17 00:00:00 2001 From: zhaowei Date: Thu, 24 Jul 2025 11:30:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BA=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=A8=A1=E5=9E=8B=E6=95=B0=E6=8D=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ExperimentParameter/index.tsx | 2 +- .../ModelDeployment/CreateVersion/index.tsx | 4 +-- .../ModelDeployment/ServiceInfo/index.tsx | 26 ++++++++++++++++--- react-ui/src/pages/ModelDeployment/types.ts | 2 +- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx b/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx index f6a3e0d5..bb9c1b63 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx +++ b/react-ui/src/pages/Experiment/components/ExperimentParameter/index.tsx @@ -58,7 +58,7 @@ function ExperimentParameter({ nodeData, globalParams }: ExperimentParameterProp )) ) : ( -
无参数
+
)} )} diff --git a/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx b/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx index c679b643..a76d67da 100644 --- a/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx +++ b/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx @@ -117,7 +117,6 @@ function CreateServiceVersion() { // 创建版本 const createServiceVersion = async (formData: FormData) => { const envList = formData['env_variables']; - const model = formData['model']; const envVariables = envList?.reduce((acc, cur) => { acc[cur.key] = cur.value; return acc; @@ -125,10 +124,9 @@ function CreateServiceVersion() { // 根据后台要求,修改表单数据 const object = { - ...omit(formData, ['replicas', 'env_variables', 'model']), + ...omit(formData, ['replicas', 'env_variables']), replicas: Number(formData.replicas), env_variables: envVariables, - model: changePropertyName(model, { showValue: 'show_value' }), service_id: serviceId, }; diff --git a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx index 617d9a32..5d47ce71 100644 --- a/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/ServiceInfo/index.tsx @@ -10,6 +10,7 @@ import SubAreaTitle from '@/components/SubAreaTitle'; import { ServiceRunStatus, serviceStatusOptions } from '@/enums'; import { useCacheState } from '@/hooks/useCacheState'; import { useComputingResource } from '@/hooks/useComputingResource'; +import { ModelData } from '@/pages/Dataset/config'; import { deleteServiceVersionReq, getServiceInfoReq, @@ -18,6 +19,7 @@ import { } from '@/services/modelDeployment'; import themes from '@/styles/theme.less'; import { formatDate } from '@/utils/date'; +import { formatModel } from '@/utils/format'; import { openAntdModal } from '@/utils/modal'; import { to } from '@/utils/promise'; import SessionStorage from '@/utils/sessionStorage'; @@ -110,8 +112,8 @@ function ServiceInfo() { if (res && res.data) { const { content = [], totalElements = 0 } = res.data; content.forEach((item: ServiceVersionData) => { - if (item.model && !item.model.show_value) { - item.model.show_value = `${item.model.name}:${item.model.version}`; + if (item.model && !item.model.showValue) { + item.model.showValue = `${item.model.name}:${item.model.version}`; } }); setTableData(content); @@ -258,6 +260,20 @@ function ServiceInfo() { }, }; + // 去模型 + const gotoModel = (record: ServiceVersionData, e: React.MouseEvent) => { + e.stopPropagation(); + + const model = record.model as any as ModelData; + const link = formatModel(model)?.link; + if (link) { + setCacheState({ + pagination, + }); + navigate(link); + } + }; + const columns: TableProps['columns'] = [ { title: '序号', @@ -278,10 +294,12 @@ function ServiceInfo() { }, { title: '模型版本', - dataIndex: ['model', 'show_value'], + dataIndex: ['model', 'showValue'], key: 'model', width: '20%', - render: tableCellRender(true), + render: tableCellRender(true, TableCellValueType.Link, { + onClick: gotoModel, + }), }, { title: '镜像版本', diff --git a/react-ui/src/pages/ModelDeployment/types.ts b/react-ui/src/pages/ModelDeployment/types.ts index fe06b84b..af1fdcc9 100644 --- a/react-ui/src/pages/ModelDeployment/types.ts +++ b/react-ui/src/pages/ModelDeployment/types.ts @@ -34,7 +34,7 @@ export type ServiceVersionData = { path: string; identifier: string; owner: string; - show_value: string; + showValue: string; }; code_config: { // 代码配置