diff --git a/react-ui/src/pages/ModelDeployment/Create/index.tsx b/react-ui/src/pages/ModelDeployment/Create/index.tsx index 5528c22..bf071fa 100644 --- a/react-ui/src/pages/ModelDeployment/Create/index.tsx +++ b/react-ui/src/pages/ModelDeployment/Create/index.tsx @@ -278,8 +278,8 @@ function ModelDeploymentCreate() { message: '请输入副本数量', }, { - pattern: /^-?\d+(\.\d+)?$/, - message: '副本数量必须是数字', + pattern: /^[1-9]\d*$/, + message: '副本数量必须是正整数', }, ]} > diff --git a/react-ui/src/pages/Pipeline/Info/utils.tsx b/react-ui/src/pages/Pipeline/Info/utils.tsx index ecb65ac..93fca2b 100644 --- a/react-ui/src/pages/Pipeline/Info/utils.tsx +++ b/react-ui/src/pages/Pipeline/Info/utils.tsx @@ -55,17 +55,21 @@ export function createMenuItems( }; }); - return [ - { - key: 'global', - label: '全局参数', - children: params.map((item) => ({ - key: item.param_name, - label: item.param_name, - })), - }, - ...nodes, - ]; + if (params.length > 0) { + return [ + { + key: 'global', + label: '全局参数', + children: params.map((item) => ({ + key: item.param_name, + label: item.param_name, + })), + }, + ...nodes, + ]; + } else { + return [...nodes]; + } } export function getInParameterComponent( diff --git a/react-ui/src/pages/Pipeline/components/PropsLabel/index.tsx b/react-ui/src/pages/Pipeline/components/PropsLabel/index.tsx index c1b2f2d..62d1fef 100644 --- a/react-ui/src/pages/Pipeline/components/PropsLabel/index.tsx +++ b/react-ui/src/pages/Pipeline/components/PropsLabel/index.tsx @@ -23,18 +23,20 @@ function PropsLabel({ title, menuItems, onClick }: PropsLabelProps) { return (
{title}
- - e.preventDefault()}>参数 - + {menuItems && menuItems.length > 0 && ( + + e.preventDefault()}>参数 + + )}
); }