From 30e7c6193af9deb0bb24626f3028a0bf023b69bc Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Tue, 25 Mar 2025 11:45:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=95=9C=E5=83=8F=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/config/routes.ts | 13 ++++++++++- react-ui/src/pages/Mirror/Create/index.tsx | 20 ++++++++--------- react-ui/src/pages/Mirror/Info/index.tsx | 19 +++++++++++----- react-ui/src/pages/Mirror/List/index.tsx | 6 ++--- react-ui/src/utils/table.tsx | 26 ++++++++++++++-------- 5 files changed, 55 insertions(+), 29 deletions(-) diff --git a/react-ui/config/routes.ts b/react-ui/config/routes.ts index a45883ab..bf51980e 100644 --- a/react-ui/config/routes.ts +++ b/react-ui/config/routes.ts @@ -271,7 +271,18 @@ export default [ { name: '镜像详情', path: 'info/:id', - component: './Mirror/Info', + routes: [ + { + name: '镜像详情', + path: '', + component: './Mirror/Info', + }, + { + name: '新增镜像版本', + path: 'add-version', + component: './Mirror/Create', + }, + ], }, { name: '创建镜像', diff --git a/react-ui/src/pages/Mirror/Create/index.tsx b/react-ui/src/pages/Mirror/Create/index.tsx index 7db2f4d0..cab4289b 100644 --- a/react-ui/src/pages/Mirror/Create/index.tsx +++ b/react-ui/src/pages/Mirror/Create/index.tsx @@ -44,7 +44,7 @@ const mirrorRadioItems: KFRadioItem[] = [ function MirrorCreate() { const navigate = useNavigate(); const [form] = Form.useForm(); - const [nameDisabled, setNameDisabled] = useState(false); + const [isAddVersion, setIsAddVersion] = useState(false); // 是制作镜像还是新增镜像版本 const { message } = App.useApp(); const uploadProps: UploadProps = { @@ -60,7 +60,7 @@ function MirrorCreate() { const name = SessionStorage.getItem(SessionStorage.mirrorNameKey); if (name) { form.setFieldValue('name', name); - setNameDisabled(true); + setIsAddVersion(true); } return () => { SessionStorage.removeItem(SessionStorage.mirrorNameKey); @@ -120,7 +120,7 @@ function MirrorCreate() { return (
- +
@@ -174,22 +174,22 @@ function MirrorCreate() { rules={[ { required: true, - message: '请输入镜像Tag', + message: '请输入镜像版本', }, { pattern: /^[a-zA-Z0-9._-]+$/, - message: '版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', + message: '镜像版本只支持字母、数字、点(.)、下划线(_)、中横线(-)', }, ]} > - + )}