修复初始化流程

This commit is contained in:
hanhh 2021-10-14 22:00:36 +08:00
parent 07e58a484c
commit bdfa08bb78
2 changed files with 57 additions and 51 deletions

View File

@ -55,15 +55,20 @@
background-color: #f6f8fa; background-color: #f6f8fa;
border: 1px solid #ebedef; border: 1px solid #ebedef;
display: flex; display: flex;
width: 500px; max-width: 500px;
height: 500px; width: 90%;
height: 350px;
.ant-steps { .ant-steps {
width: 150px; width: 35%;
display: flex;
align-items: center;
position: relative;
top: 6%;
} }
.steps-container { .steps-container {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
padding-right: 20px;
} }
} }

View File

@ -62,7 +62,7 @@ const Initialization = () => {
if (_data && _data.code === 200) { if (_data && _data.code === 200) {
next(); next();
} else { } else {
message.error(_data.data); message.error(_data.message);
} }
}) })
.finally(() => setLoading(false)); .finally(() => setLoading(false));
@ -77,7 +77,7 @@ const Initialization = () => {
{ {
title: '欢迎使用', title: '欢迎使用',
content: ( content: (
<div className={styles.top} style={{ marginTop: 120 }}> <div className={styles.top} style={{ marginTop: 100 }}>
<div className={styles.header}> <div className={styles.header}>
<span className={styles.title}>使</span> <span className={styles.title}>使</span>
</div> </div>
@ -94,6 +94,50 @@ const Initialization = () => {
</div> </div>
), ),
}, },
{
title: '通知设置',
content: (
<Form onFinish={submitNotification} layout="vertical">
<Form.Item
label="通知方式"
name="type"
rules={[{ required: true, message: '请选择通知方式' }]}
style={{ maxWidth: 350 }}
>
<Select
onChange={notificationModeChange}
placeholder="请选择通知方式"
>
{config.notificationModes
.filter((x) => x.value !== 'closed')
.map((x) => (
<Option value={x.value}>{x.label}</Option>
))}
</Select>
</Form.Item>
{fields.map((x) => (
<Form.Item
label={x.label}
name={x.label}
extra={x.tip}
rules={[{ required: x.required }]}
style={{ maxWidth: 400 }}
>
<Input.TextArea
autoSize={true}
placeholder={`请输入${x.label}`}
/>
</Form.Item>
))}
<Button type="primary" htmlType="submit" loading={loading}>
</Button>
<Button type="link" htmlType="button" onClick={() => next()}>
</Button>
</Form>
),
},
{ {
title: '账户设置', title: '账户设置',
content: ( content: (
@ -143,54 +187,10 @@ const Initialization = () => {
</Form> </Form>
), ),
}, },
{
title: '通知设置',
content: (
<Form onFinish={submitNotification} layout="vertical">
<Form.Item
label="通知方式"
name="type"
rules={[{ required: true, message: '请选择通知方式' }]}
style={{ maxWidth: 350 }}
>
<Select
onChange={notificationModeChange}
placeholder="请选择通知方式"
>
{config.notificationModes
.filter((x) => x.value !== 'closed')
.map((x) => (
<Option value={x.value}>{x.label}</Option>
))}
</Select>
</Form.Item>
{fields.map((x) => (
<Form.Item
label={x.label}
name={x.label}
extra={x.tip}
rules={[{ required: x.required }]}
style={{ maxWidth: 400 }}
>
<Input.TextArea
autoSize={true}
placeholder={`请输入${x.label}`}
/>
</Form.Item>
))}
<Button type="primary" htmlType="submit" loading={loading}>
</Button>
<Button type="link" htmlType="button" onClick={() => next()}>
</Button>
</Form>
),
},
{ {
title: '完成安装', title: '完成安装',
content: ( content: (
<div className={styles.top} style={{ marginTop: 120 }}> <div className={styles.top} style={{ marginTop: 100 }}>
<div className={styles.header}> <div className={styles.header}>
<span className={styles.title}></span> <span className={styles.title}></span>
<Link href="https://github.com/whyour/qinglong" target="_blank"> <Link href="https://github.com/whyour/qinglong" target="_blank">
@ -227,6 +227,7 @@ const Initialization = () => {
<Steps <Steps
current={current} current={current}
direction="vertical" direction="vertical"
size="small"
className={styles['ant-steps']} className={styles['ant-steps']}
> >
{steps.map((item) => ( {steps.map((item) => (