From 274b8612e9ef8ec884067e429bf78b343d0d8832 Mon Sep 17 00:00:00 2001 From: zhaowei Date: Mon, 26 May 2025 10:22:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E6=B5=81=E6=B0=B4=E7=BA=BF=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E9=83=A8=E7=BD=B2=E6=9C=8D=E5=8A=A1=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/pages/Pipeline/Info/index.jsx | 2 +- .../components/PipelineNodeDrawer/index.tsx | 30 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/react-ui/src/pages/Pipeline/Info/index.jsx b/react-ui/src/pages/Pipeline/Info/index.jsx index 27003d68..4e86dbbb 100644 --- a/react-ui/src/pages/Pipeline/Info/index.jsx +++ b/react-ui/src/pages/Pipeline/Info/index.jsx @@ -110,7 +110,7 @@ const EditPipeline = () => { // console.log(data); const errorNode = data.nodes.find((item) => item.formError === true); if (errorNode) { - message.error(`【${errorNode.label}】节点必填项必须配置`); + message.error(`【${errorNode.label}】节点配置验证失败`); const graphNode = graph.findById(errorNode.id); if (graphNode) { openNodeDrawer(graphNode, true); diff --git a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx index 44b35d2b..9279e76d 100644 --- a/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx +++ b/react-ui/src/pages/Pipeline/components/PipelineNodeDrawer/index.tsx @@ -19,6 +19,7 @@ import { openAntdModal } from '@/utils/modal'; import { to } from '@/utils/promise'; import { INode } from '@antv/g6'; import { Button, Drawer, Form, Input, MenuProps } from 'antd'; +import { RuleObject } from 'antd/es/form'; import { NamePath } from 'antd/es/form/interface'; import { forwardRef, useImperativeHandle, useState } from 'react'; import PropsLabel from '../PropsLabel'; @@ -309,16 +310,41 @@ const PipelineNodeParameter = forwardRef(({ onFormChange }: PipelineNodeParamete ); }; + // 模型部署-服务版本验证 + const serviceVersionValidator = (_rule: RuleObject, value: any) => { + // 输入参数值都是对象,如果是手动输入,要求 /^[a-zA-Z0-9._-]+$/ + if ( + typeof value === 'object' && + value && + !value.fromSelect && + value.value && + !/^[a-zA-Z0-9._-]+$/.test(value.value) + ) { + return Promise.reject('服务版本只支持字母、数字、点(.)、下划线(_)、中横线(-)'); + } + + return Promise.resolve(); + }; + // 必填项校验规则 const getFormRules = (item: { key: string; value: PipelineNodeModelParameter }) => { - return item.value.require + const id = form.getFieldValue('id') as string; + const rules = item.value.require ? [ { validator: requiredValidator, - message: '必填项', }, ] : []; + + // 模型部署-服务版本验证 + if (id.startsWith('model-deploy') && item.key === '--version') { + rules.push({ + validator: serviceVersionValidator, + }); + } + + return rules; }; // 控制策略 From d1c41934b0a6055cc9490df40d9731ef0df5a14f Mon Sep 17 00:00:00 2001 From: zhaowei Date: Mon, 26 May 2025 10:23:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E9=A2=84=E6=B5=8B=E6=9C=89=E4=B8=A4?= =?UTF-8?q?=E4=B8=AAloading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/IFramePage/index.tsx | 38 +++++++++++++------ .../ModelDeployment/VersionInfo/index.tsx | 2 +- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/react-ui/src/components/IFramePage/index.tsx b/react-ui/src/components/IFramePage/index.tsx index 8832b049..1982c816 100644 --- a/react-ui/src/components/IFramePage/index.tsx +++ b/react-ui/src/components/IFramePage/index.tsx @@ -58,6 +58,8 @@ type IframePageProps = { url?: string; /** 是否可以在页签上打开 */ openInTab?: boolean; + /** 是否显示加载 */ + showLoading?: boolean; /** 自定义样式类名 */ className?: string; /** 自定义样式 */ @@ -65,40 +67,54 @@ type IframePageProps = { }; /** 系统内嵌 iframe,目前系统有数据标注、应用开发、开发环境、GitLink 四个子系统,使用时可以添加其他子系统 */ -function IframePage({ type, url, openInTab = false, className, style }: IframePageProps) { +function IframePage({ + type, + url, + showLoading = true, + openInTab = false, + className, + style, +}: IframePageProps) { const [iframeUrl, setIframeUrl] = useState(''); // const [loading, setLoading] = useState(false); useEffect(() => { const requestIframeUrl = async (type: IframePageType) => { - // setLoading(true); - Loading.show(); + if (showLoading) { + Loading.show(); + } const [res] = await to(getRequestAPI(type)()); if (res && res.data) { setIframeUrl(res.data); } else { - Loading.hide(); - // setLoading(false); + if (showLoading) { + Loading.hide(); + } } }; if (type) { requestIframeUrl(type); } else if (url) { - Loading.show(); + if (showLoading) { + Loading.show(); + } + setIframeUrl(url); } - }, [type, url]); + }, [type, url, showLoading]); const handleLoad = () => { - // setLoading(false); - Loading.hide(); + if (showLoading) { + Loading.hide(); + } }; const handleError = (error?: React.SyntheticEvent) => { - // setLoading(false); console.log('error', error); - Loading.hide(); + if (showLoading) { + Loading.hide(); + } }; return ( diff --git a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx index 6809ed88..23d836f5 100644 --- a/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx +++ b/react-ui/src/pages/ModelDeployment/VersionInfo/index.tsx @@ -58,7 +58,7 @@ function ServiceVersionInfo() { key: ModelDeploymentTabKey.Predict, label: '预测', icon: , - children: , + children: , }); } From b2b74686cab9b95b9100507dd44453fc89e3de0f Mon Sep 17 00:00:00 2001 From: zhaowei Date: Mon, 26 May 2025 11:00:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/AutoML/components/ExperimentList/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx b/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx index 036f0d01..7951d769 100644 --- a/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx +++ b/react-ui/src/pages/AutoML/components/ExperimentList/index.tsx @@ -395,9 +395,9 @@ function ExperimentList({ type }: ExperimentListProps) { }, ...diffColumns, { - title: '创建时间', - dataIndex: 'create_time', - key: 'create_time', + title: '更新时间', + dataIndex: 'update_time', + key: 'update_time', width: '20%', render: tableCellRender(true, TableCellValueType.Date), },