Optimize code
This commit is contained in:
@@ -46,7 +46,7 @@ const Base = () => {
|
||||
return (
|
||||
<>
|
||||
<SettingsCard
|
||||
icon={IconOxygenEmail}
|
||||
icon={IconOxygenBase}
|
||||
title={'基础'}
|
||||
loading={loading}
|
||||
onReset={handleOnReset}
|
||||
|
||||
@@ -17,6 +17,8 @@ const Mail = () => {
|
||||
const handleOnTest = () => {
|
||||
void modal.confirm({
|
||||
title: '发送测试邮件',
|
||||
getContainer: false,
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<>
|
||||
@@ -27,7 +29,11 @@ const Mail = () => {
|
||||
style={{ marginTop: 10 }}
|
||||
rules={[{ required: true, type: 'email' }]}
|
||||
>
|
||||
<AntdInput />
|
||||
<AntdInput
|
||||
ref={(input) => {
|
||||
input?.focus()
|
||||
}}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
<AntdTag style={{ whiteSpace: 'normal' }}>
|
||||
@@ -56,7 +62,7 @@ const Mail = () => {
|
||||
},
|
||||
() => {
|
||||
return new Promise((_, reject) => {
|
||||
reject('未输入接收者')
|
||||
reject('输入有误')
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
@@ -232,6 +232,7 @@ const Base = () => {
|
||||
compileForm.setFieldValue('entryFileName', undefined)
|
||||
void modal.confirm({
|
||||
title: '编译',
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<>
|
||||
@@ -537,6 +538,8 @@ const Base = () => {
|
||||
const handleOnAddFile = () => {
|
||||
void modal.confirm({
|
||||
title: '新建文件',
|
||||
getContainer: false,
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<AntdForm form={addFileForm}>
|
||||
@@ -565,7 +568,11 @@ const Base = () => {
|
||||
})
|
||||
]}
|
||||
>
|
||||
<AntdInput />
|
||||
<AntdInput
|
||||
ref={(input) => {
|
||||
input?.focus()
|
||||
}}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
),
|
||||
@@ -714,6 +721,8 @@ const Base = () => {
|
||||
renameFileForm.setFieldValue('fileName', fileName)
|
||||
void modal.confirm({
|
||||
title: '重命名文件',
|
||||
getContainer: false,
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<AntdForm form={renameFileForm}>
|
||||
@@ -745,7 +754,11 @@ const Base = () => {
|
||||
})
|
||||
]}
|
||||
>
|
||||
<AntdInput />
|
||||
<AntdInput
|
||||
ref={(input) => {
|
||||
input?.focus()
|
||||
}}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
),
|
||||
|
||||
@@ -399,6 +399,8 @@ const Template = () => {
|
||||
const handleOnAddFile = () => {
|
||||
void modal.confirm({
|
||||
title: '新建文件',
|
||||
getContainer: false,
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<AntdForm form={addFileForm}>
|
||||
@@ -427,7 +429,11 @@ const Template = () => {
|
||||
})
|
||||
]}
|
||||
>
|
||||
<AntdInput />
|
||||
<AntdInput
|
||||
ref={(input) => {
|
||||
input?.focus()
|
||||
}}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
),
|
||||
@@ -579,6 +585,8 @@ const Template = () => {
|
||||
renameFileForm.setFieldValue('fileName', fileName)
|
||||
void modal.confirm({
|
||||
title: '重命名文件',
|
||||
getContainer: false,
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<AntdForm form={renameFileForm}>
|
||||
@@ -610,7 +618,11 @@ const Template = () => {
|
||||
})
|
||||
]}
|
||||
>
|
||||
<AntdInput />
|
||||
<AntdInput
|
||||
ref={(input) => {
|
||||
input?.focus()
|
||||
}}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
),
|
||||
|
||||
@@ -195,6 +195,7 @@ const Tools = () => {
|
||||
form.setFieldValue('pass', undefined)
|
||||
void modal.confirm({
|
||||
title: '审核',
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<AntdForm form={form}>
|
||||
|
||||
@@ -336,6 +336,8 @@ const User = () => {
|
||||
修改用户 {value.username} 的密码
|
||||
</>
|
||||
),
|
||||
getContainer: false,
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<AntdForm
|
||||
@@ -356,7 +358,11 @@ const User = () => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<AntdInput.Password />
|
||||
<AntdInput.Password
|
||||
ref={(input) => {
|
||||
input?.focus()
|
||||
}}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item
|
||||
name={'passwordConfirm'}
|
||||
|
||||
@@ -262,6 +262,8 @@ const Tools = () => {
|
||||
const handleOnUpgradeTool = (tool: ToolVo) => {
|
||||
void modal.confirm({
|
||||
title: '更新工具',
|
||||
getContainer: false,
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
content: (
|
||||
<>
|
||||
@@ -285,7 +287,14 @@ const Tools = () => {
|
||||
}
|
||||
]}
|
||||
>
|
||||
<AntdInput maxLength={10} showCount placeholder={'请输入版本'} />
|
||||
<AntdInput
|
||||
maxLength={10}
|
||||
showCount
|
||||
placeholder={'请输入版本'}
|
||||
ref={(input) => {
|
||||
input?.focus()
|
||||
}}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user