From 0c4e5338f31a0e24ac35036f0cf43bde69310575 Mon Sep 17 00:00:00 2001 From: shuai Date: Thu, 17 Aug 2023 11:13:39 +0800 Subject: [PATCH] feat: install add private switch --- i18n/en_US.yaml | 3 +++ .../Install/components/FourthStep/index.tsx | 20 +++++++++++++++++++ ui/src/pages/Install/index.tsx | 8 +++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 39c8632c..c28b0352 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -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. diff --git a/ui/src/pages/Install/components/FourthStep/index.tsx b/ui/src/pages/Install/components/FourthStep/index.tsx index 441a9984..8e6e2b0e 100644 --- a/ui/src/pages/Install/components/FourthStep/index.tsx +++ b/ui/src/pages/Install/components/FourthStep/index.tsx @@ -192,6 +192,26 @@ const Index: FC = ({ visible, data, changeCallback, nextCallback }) => { + + {t('login_required.label')} + { + console.log(e.target.checked); + changeCallback({ + login_required: { + value: e.target.checked, + isInvalid: false, + errorMsg: '', + }, + }); + }} + /> + +
{t('admin_account')}
{t('admin_name.label')} diff --git a/ui/src/pages/Install/index.tsx b/ui/src/pages/Install/index.tsx index f3a9f85c..0f78e23c 100644 --- a/ui/src/pages/Install/index.tsx +++ b/ui/src/pages/Install/index.tsx @@ -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,