mirror of https://gitee.com/answerdev/answer.git
feat: install add private switch
This commit is contained in:
parent
faf6545f7e
commit
0c4e5338f3
|
@ -1259,6 +1259,9 @@ ui:
|
|||
msg:
|
||||
empty: Contact Email cannot be empty.
|
||||
incorrect: Contact Email incorrect format.
|
||||
login_required:
|
||||
label: Private
|
||||
switch: Login required
|
||||
admin_name:
|
||||
label: Name
|
||||
msg: Name cannot be empty.
|
||||
|
|
|
@ -192,6 +192,26 @@ const Index: FC<Props> = ({ visible, data, changeCallback, nextCallback }) => {
|
|||
</Form.Control.Feedback>
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group controlId="login_required" className="mb-3">
|
||||
<Form.Label>{t('login_required.label')}</Form.Label>
|
||||
<Form.Check
|
||||
type="switch"
|
||||
id="login_required"
|
||||
label={t('login_required.switch')}
|
||||
checked={data.login_required.value}
|
||||
onChange={(e) => {
|
||||
console.log(e.target.checked);
|
||||
changeCallback({
|
||||
login_required: {
|
||||
value: e.target.checked,
|
||||
isInvalid: false,
|
||||
errorMsg: '',
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</Form.Group>
|
||||
|
||||
<h5>{t('admin_account')}</h5>
|
||||
<Form.Group controlId="name" className="mb-3">
|
||||
<Form.Label>{t('admin_name.label')}</Form.Label>
|
||||
|
|
|
@ -23,7 +23,7 @@ import {
|
|||
|
||||
const Index: FC = () => {
|
||||
const { t } = useTranslation('translation', { keyPrefix: 'install' });
|
||||
const [step, setStep] = useState(1);
|
||||
const [step, setStep] = useState(4);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [errorData, setErrorData] = useState<{ [propName: string]: any }>({
|
||||
msg: '',
|
||||
|
@ -84,6 +84,11 @@ const Index: FC = () => {
|
|||
isInvalid: false,
|
||||
errorMsg: '',
|
||||
},
|
||||
login_required: {
|
||||
value: false,
|
||||
isInvalid: false,
|
||||
errorMsg: '',
|
||||
},
|
||||
name: {
|
||||
value: '',
|
||||
isInvalid: false,
|
||||
|
@ -164,6 +169,7 @@ const Index: FC = () => {
|
|||
site_name: formData.site_name.value,
|
||||
site_url: formData.site_url.value,
|
||||
contact_email: formData.contact_email.value,
|
||||
login_required: formData.login_required.value,
|
||||
name: formData.name.value,
|
||||
password: formData.password.value,
|
||||
email: formData.email.value,
|
||||
|
|
Loading…
Reference in New Issue