Feat/install process refinement (#3982)

This commit is contained in:
crazywoola 2024-04-29 17:55:52 +08:00 committed by GitHub
parent 1d432728ac
commit c5e2659771
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 871 additions and 840 deletions

View File

@ -25,7 +25,6 @@ import Link from 'next/link'
import s from './style.module.css'
import { fetchDatasetDetail, fetchDatasetRelatedApps } from '@/service/datasets'
import type { RelatedApp, RelatedAppResponse } from '@/models/datasets'
import { getLocaleOnClient } from '@/i18n'
import AppSideBar from '@/app/components/app-sidebar'
import Divider from '@/app/components/base/divider'
import AppIcon from '@/app/components/base/app-icon'
@ -38,6 +37,7 @@ import { LanguagesSupported } from '@/i18n/language'
import { useStore } from '@/app/components/app/store'
import { AiText, ChatBot, CuteRobote } from '@/app/components/base/icons/src/vender/solid/communication'
import { Route } from '@/app/components/base/icons/src/vender/solid/mapsAndTravel'
import { getLocaleOnServer } from '@/i18n/server'
export type IAppDetailLayoutProps = {
children: React.ReactNode
@ -119,7 +119,7 @@ type IExtraInfoProps = {
}
const ExtraInfo = ({ isMobile, relatedApps }: IExtraInfoProps) => {
const locale = getLocaleOnClient()
const locale = getLocaleOnServer()
const [isShowTips, { toggle: toggleTips, set: setShowTips }] = useBoolean(!isMobile)
const { t } = useTranslation()

View File

@ -86,7 +86,7 @@ const ActivateForm = () => {
timezone,
},
})
setLocaleOnClient(language.startsWith('en') ? 'en' : 'zh-Hans', false)
setLocaleOnClient(language.startsWith('en') ? 'en-US' : 'zh-Hans', false)
setShowSuccess(true)
}
catch {

View File

@ -60,7 +60,7 @@ const EnterpriseSSOForm: FC<EnterpriseSSOFormProps> = ({
return (
<div className={
cn(
'flex flex-col items-center w-full grow items-center justify-center',
'flex flex-col items-center w-full grow justify-center',
'px-6',
'md:px-[108px]',
)

View File

@ -20,7 +20,7 @@ const Forms = () => {
}
return <div className={
cn(
'flex flex-col items-center w-full grow items-center justify-center',
'flex flex-col items-center w-full grow justify-center',
'px-6',
'md:px-[108px]',
)

View File

@ -245,7 +245,7 @@ const NormalForm = () => {
<span className='cursor-pointer text-primary-600'>{t('login.forget')}</span>
</Tooltip> */}
</label>
<div className="relative mt-1 rounded-md shadow-sm">
<div className="relative mt-1">
<input
id="password"
value={password}
@ -300,6 +300,15 @@ const NormalForm = () => {
>{t('login.pp')}</Link>
</div>
{IS_CE_EDITION && <div className="w-hull text-center block mt-2 text-xs text-gray-600">
{t('login.goToInit')}
&nbsp;
<Link
className='text-primary-600'
href='/install'
>{t('login.setAdminAccount')}</Link>
</div>}
</div>
</div>
</>

View File

@ -61,7 +61,7 @@ gtag('config', 'AW-11217955271"');
{loading && (
<div className={
cn(
'flex flex-col items-center w-full grow items-center justify-center',
'flex flex-col items-center w-full grow justify-center',
'px-6',
'md:px-[108px]',
)

View File

@ -8,13 +8,13 @@ import { getLanguage } from '@/i18n/language'
type II18NContext = {
locale: Locale
i18n: Record<string, any>
setLocaleOnClient: (locale: Locale, reloadPage?: boolean) => void
setLocaleOnClient: (_lang: Locale, _reloadPage?: boolean) => void
}
const I18NContext = createContext<II18NContext>({
locale: 'en-US',
i18n: {},
setLocaleOnClient: (lang: Locale, reloadPage?: boolean) => { },
setLocaleOnClient: (_lang: Locale, _reloadPage?: boolean) => { },
})
export const useI18N = () => useContext(I18NContext)

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: 'Chinesisch',
zhHant: 'Chinesisch (traditionell)',
enUS: 'Englisch',
deDE: 'Deutsch',
frFR: 'Französisch',
@ -56,6 +57,7 @@ const translation = {
ptBR: 'Portugiesisch',
ruRU: 'Russisch',
ukUA: 'Ukrainisch',
viVN: 'Vietnamesisch',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: 'Nutzungsbedingungen',
pp: 'Datenschutzbestimmungen',
tosDesc: 'Mit der Anmeldung stimmst du unseren',
goToInit: 'Wenn du das Konto noch nicht initialisiert hast, gehe bitte zur Initialisierungsseite',
donthave: 'Hast du nicht?',
invalidInvitationCode: 'Ungültiger Einladungscode',
accountAlreadyInited: 'Konto bereits initialisiert',

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: 'Chinese',
zhHant: 'Traditional Chinese',
enUS: 'English',
deDE: 'German',
frFR: 'French',
@ -56,6 +57,7 @@ const translation = {
ptBR: 'Portuguese',
ruRU: 'Russian',
ukUA: 'Ukrainian',
viVN: 'Vietnamese',
},
},
unit: {

View File

@ -31,6 +31,7 @@ const translation = {
tos: 'Terms of Service',
pp: 'Privacy Policy',
tosDesc: 'By signing up, you agree to our',
goToInit: 'If you have not initialized the account, please go to the initialization page',
donthave: 'Don\'t have?',
invalidInvitationCode: 'Invalid invitation code',
accountAlreadyInited: 'Account already initialized',

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: 'Chinois',
zhHant: 'Chinois (traditionnel)',
enUS: 'Anglais',
deDE: 'Allemand',
frFR: 'Français',
@ -56,6 +57,7 @@ const translation = {
ptBR: 'Portugais',
ruRU: 'Russe',
ukUA: 'Ukrainien',
viVN: 'Vietnamien',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: 'Conditions de Service',
pp: 'Politique de Confidentialité',
tosDesc: 'En vous inscrivant, vous acceptez nos',
goToInit: 'Si vous n\'avez pas initialisé le compte, veuillez vous rendre sur la page d\'initialisation',
donthave: 'Vous n\'avez pas ?',
invalidInvitationCode: 'Code d\'invitation invalide',
accountAlreadyInited: 'Compte déjà initialisé',

View File

@ -11,10 +11,6 @@ export const i18n = {
export type Locale = typeof i18n['locales'][number]
export const getLocaleOnClient = (): Locale => {
return Cookies.get(LOCALE_COOKIE_NAME) as Locale || i18n.defaultLocale
}
export const setLocaleOnClient = (locale: Locale, reloadPage = true) => {
Cookies.set(LOCALE_COOKIE_NAME, locale)
changeLanguage(locale)

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: '中国語',
zhHant: '繁体字中国語',
enUS: '英語',
deDE: 'ドイツ語',
frFR: 'フランス語',
@ -56,6 +57,7 @@ const translation = {
ptBR: 'ポルトガル語',
ruRU: 'ロシア語',
ukUA: 'ウクライナ語',
viVN: 'ベトナム語',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: '利用規約',
pp: 'プライバシーポリシー',
tosDesc: 'サインアップすることで、以下に同意するものとします',
goToInit: 'アカウントを初期化していない場合は、初期化ページに移動してください',
donthave: 'お持ちでない場合',
invalidInvitationCode: '無効な招待コード',
accountAlreadyInited: 'アカウントは既に初期化されています',

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: 'Chinês',
zhHant: 'Chinês Tradicional',
enUS: 'Inglês',
deDE: 'Alemão',
frFR: 'Francês',
@ -56,6 +57,7 @@ const translation = {
ptBR: 'Português',
ruRU: 'Russo',
ukUA: 'Ucraniano',
viVN: 'Vietnamita',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: 'Termos de Serviço',
pp: 'Política de Privacidade',
tosDesc: 'Ao se inscrever, você concorda com nossos',
goToInit: 'Se você não inicializou a conta, vá para a página de inicialização',
donthave: 'Não tem?',
invalidInvitationCode: 'Código de convite inválido',
accountAlreadyInited: 'Conta já iniciada',

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: 'Китайська',
zhHant: 'Китайська (традиційна)',
enUS: 'Англійська',
deDE: 'Німецька',
frFR: 'Французька',
@ -56,6 +57,7 @@ const translation = {
ptBR: 'Португальська',
ruRU: 'Російська',
ukUA: 'Українська',
viVN: 'В\'є тнамська',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: 'Умови обслуговування',
pp: 'Політика конфіденційності',
tosDesc: 'Реєструючись, ви приймаєте наші',
goToInit: 'Якщо ви ще не ініціалізували обліковий запис, перейдіть на сторінку ініціалізації',
donthave: 'Не маєте?',
invalidInvitationCode: 'Недійсний код запрошення',
accountAlreadyInited: 'Обліковий запис уже ініціалізовано',

View File

@ -56,6 +56,7 @@ const translation = {
ptBR: 'Tiếng Bồ Đào Nha',
ruRU: 'Tiếng Nga',
ukUA: 'Tiếng Ukraina',
viVN: 'Tiếng Việt',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: 'Điều khoản dịch vụ',
pp: 'Chính sách bảo mật',
tosDesc: 'Bằng cách đăng ký, bạn đồng ý với',
goToInit: 'Nếu bạn chưa khởi tạo tài khoản, vui lòng đi đến trang khởi tạo',
donthave: 'Chưa có?',
invalidInvitationCode: 'Mã mời không hợp lệ',
accountAlreadyInited: 'Tài khoản đã được khởi tạo',

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: '中文',
zhHant: '繁体中文',
enUS: '英语',
deDE: '德语',
frFR: '法语',
@ -56,6 +57,7 @@ const translation = {
ptBR: '葡萄牙语',
ruRU: '俄语',
ukUA: '乌克兰语',
viVN: '越南语',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: '使用协议',
pp: '隐私政策',
tosDesc: '使用即代表你并同意我们的',
goToInit: '如果您还没有初始化账户,请前往初始化页面',
donthave: '还没有邀请码?',
invalidInvitationCode: '无效的邀请码',
accountAlreadyInited: '账户已经初始化',

View File

@ -44,6 +44,7 @@ const translation = {
voice: {
language: {
zhHans: '中文',
zhHant: '繁體中文',
enUS: '英語',
deDE: '德語',
frFR: '法語',
@ -56,6 +57,7 @@ const translation = {
ptBR: '葡萄牙語',
ruRU: '俄語',
ukUA: '烏克蘭語',
viVN: '越南語',
},
},
unit: {

View File

@ -30,6 +30,7 @@ const translation = {
tos: '使用協議',
pp: '隱私政策',
tosDesc: '使用即代表你並同意我們的',
goToInit: '如果您還沒有初始化賬戶,請前往初始化頁面',
donthave: '還沒有邀請碼?',
invalidInvitationCode: '無效的邀請碼',
accountAlreadyInited: '賬戶已經初始化',