Skip to content

Commit 0c4e533

Browse files
author
shuai
committed
feat: install add private switch
1 parent faf6545 commit 0c4e533

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

i18n/en_US.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,9 @@ ui:
12591259
msg:
12601260
empty: Contact Email cannot be empty.
12611261
incorrect: Contact Email incorrect format.
1262+
login_required:
1263+
label: Private
1264+
switch: Login required
12621265
admin_name:
12631266
label: Name
12641267
msg: Name cannot be empty.

ui/src/pages/Install/components/FourthStep/index.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,26 @@ const Index: FC<Props> = ({ visible, data, changeCallback, nextCallback }) => {
192192
</Form.Control.Feedback>
193193
</Form.Group>
194194

195+
<Form.Group controlId="login_required" className="mb-3">
196+
<Form.Label>{t('login_required.label')}</Form.Label>
197+
<Form.Check
198+
type="switch"
199+
id="login_required"
200+
label={t('login_required.switch')}
201+
checked={data.login_required.value}
202+
onChange={(e) => {
203+
console.log(e.target.checked);
204+
changeCallback({
205+
login_required: {
206+
value: e.target.checked,
207+
isInvalid: false,
208+
errorMsg: '',
209+
},
210+
});
211+
}}
212+
/>
213+
</Form.Group>
214+
195215
<h5>{t('admin_account')}</h5>
196216
<Form.Group controlId="name" className="mb-3">
197217
<Form.Label>{t('admin_name.label')}</Form.Label>

ui/src/pages/Install/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323

2424
const Index: FC = () => {
2525
const { t } = useTranslation('translation', { keyPrefix: 'install' });
26-
const [step, setStep] = useState(1);
26+
const [step, setStep] = useState(4);
2727
const [loading, setLoading] = useState(true);
2828
const [errorData, setErrorData] = useState<{ [propName: string]: any }>({
2929
msg: '',
@@ -84,6 +84,11 @@ const Index: FC = () => {
8484
isInvalid: false,
8585
errorMsg: '',
8686
},
87+
login_required: {
88+
value: false,
89+
isInvalid: false,
90+
errorMsg: '',
91+
},
8792
name: {
8893
value: '',
8994
isInvalid: false,
@@ -164,6 +169,7 @@ const Index: FC = () => {
164169
site_name: formData.site_name.value,
165170
site_url: formData.site_url.value,
166171
contact_email: formData.contact_email.value,
172+
login_required: formData.login_required.value,
167173
name: formData.name.value,
168174
password: formData.password.value,
169175
email: formData.email.value,

0 commit comments

Comments
 (0)