Browse Source

fix: 添加镜像版本描述

pull/228/head
cp3hnu 10 months ago
parent
commit
7a4852908b
2 changed files with 37 additions and 6 deletions
  1. +8
    -0
      react-ui/src/pages/Mirror/Create/index.less
  2. +29
    -6
      react-ui/src/pages/Mirror/Create/index.tsx

+ 8
- 0
react-ui/src/pages/Mirror/Create/index.less View File

@@ -9,6 +9,14 @@
background-color: white; background-color: white;
border-radius: 10px; border-radius: 10px;


&__name-row {
:global {
.ant-form-item-row {
flex-wrap: nowrap;
}
}
}

&__type { &__type {
color: @text-color; color: @text-color;
font-size: @font-size-input-lg; font-size: @font-size-input-lg;


+ 29
- 6
react-ui/src/pages/Mirror/Create/index.tsx View File

@@ -123,8 +123,6 @@ function MirrorCreate() {
return true; return true;
}; };


const descTitle = isAddVersion ? '版本描述' : '镜像描述';

return ( return (
<div className={styles['mirror-create']}> <div className={styles['mirror-create']}>
<PageTitle title={!isAddVersion ? '创建镜像' : '新增镜像版本'}></PageTitle> <PageTitle title={!isAddVersion ? '创建镜像' : '新增镜像版本'}></PageTitle>
@@ -161,6 +159,7 @@ function MirrorCreate() {
message: '只支持小写字母、数字、点(.)、下划线(_)、中横线(-)、斜杠(/)', message: '只支持小写字母、数字、点(.)、下划线(_)、中横线(-)、斜杠(/)',
}, },
]} ]}
className={styles['mirror-create__content__name-row']}
> >
<Input <Input
placeholder="请输入镜像名称" placeholder="请输入镜像名称"
@@ -193,21 +192,45 @@ function MirrorCreate() {
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
{!isAddVersion && (
<Row gutter={10}>
<Col span={20}>
<Form.Item
label="镜像描述"
name="description"
rules={[
{
required: true,
message: '请输入镜像描述',
},
]}
>
<Input.TextArea
autoSize={{ minRows: 2, maxRows: 6 }}
placeholder="请输入镜像描述"
maxLength={128}
showCount
allowClear
/>
</Form.Item>
</Col>
</Row>
)}
<Row gutter={10}> <Row gutter={10}>
<Col span={20}> <Col span={20}>
<Form.Item <Form.Item
label={descTitle}
name="description"
label="版本描述"
name="version_description"
rules={[ rules={[
{ {
required: true, required: true,
message: `请输入${descTitle}`,
message: '请输入版本描述',
}, },
]} ]}
> >
<Input.TextArea <Input.TextArea
autoSize={{ minRows: 2, maxRows: 6 }} autoSize={{ minRows: 2, maxRows: 6 }}
placeholder={`请输入${descTitle}`}
placeholder="请输入版本描述"
maxLength={128} maxLength={128}
showCount showCount
allowClear allowClear


Loading…
Cancel
Save