diff --git a/docs/website/src/pages/self-hosting/index.tsx b/docs/website/src/pages/self-hosting/index.tsx index 72910df9edb..6ede32c23f0 100644 --- a/docs/website/src/pages/self-hosting/index.tsx +++ b/docs/website/src/pages/self-hosting/index.tsx @@ -1,6 +1,6 @@ import { PC_MIN_WIDTH } from '@site/src/constants/platform'; import useWindow from '@site/src/hooks/useWindow'; -import React, { useMemo } from 'react'; +import React, { useEffect, useMemo } from 'react'; import Footer from '../components/Footer'; import Header from './header'; import './index.scss'; @@ -14,6 +14,12 @@ export default function Pricing() { const { screenWidth } = useWindow(); const isPc = useMemo(() => screenWidth > PC_MIN_WIDTH, [screenWidth]); + useEffect(() => { + const urlParams = new URLSearchParams(window.location.search); + const value = urlParams.get('bd_vid'); + sessionStorage.setItem('bd_vid', value); + }, []); + return (
diff --git a/frontend/desktop/src/api/platform.ts b/frontend/desktop/src/api/platform.ts index c88b4273fdd..56fe3929335 100644 --- a/frontend/desktop/src/api/platform.ts +++ b/frontend/desktop/src/api/platform.ts @@ -13,7 +13,7 @@ import { AccountCRD } from '@/types/user'; // handle baidu export const uploadConvertData = (newType: number[], url?: string) => { - const defaultUrl = 'https://sealos.run/'; + const defaultUrl = 'https://sealos.run/self-hosting'; const main_url = url || defaultUrl; const bd_vid = sessionStorage.getItem('bd_vid'); if (!bd_vid) { diff --git a/frontend/desktop/src/components/AppDock/index.module.css b/frontend/desktop/src/components/AppDock/index.module.css index f79511bc9cd..d33f3a385f0 100644 --- a/frontend/desktop/src/components/AppDock/index.module.css +++ b/frontend/desktop/src/components/AppDock/index.module.css @@ -7,6 +7,7 @@ top: 0; left: 0; min-width: 140px; + position: absolute; } .arrow { diff --git a/frontend/desktop/src/pages/index.tsx b/frontend/desktop/src/pages/index.tsx index 3f78594ff12..3a1d62474ff 100644 --- a/frontend/desktop/src/pages/index.tsx +++ b/frontend/desktop/src/pages/index.tsx @@ -12,8 +12,7 @@ import { useRouter } from 'next/router'; import Script from 'next/script'; import { createContext, useEffect, useState } from 'react'; import useCallbackStore from '@/stores/callback'; -import FloatButton from '@/components/floating_button'; -// import 'react-contexify/dist/ReactContexify.css'; +import 'react-contexify/dist/ReactContexify.css'; const destination = '/signin'; interface IMoreAppsContext { diff --git a/frontend/desktop/src/types/i18next.d.ts b/frontend/desktop/src/types/i18next.d.ts index 2bb75540b8b..e78cd62bb0d 100644 --- a/frontend/desktop/src/types/i18next.d.ts +++ b/frontend/desktop/src/types/i18next.d.ts @@ -12,9 +12,23 @@ export interface I18nNamespaces { export type I18nNsType = (keyof I18nNamespaces)[]; -export type I18nCommonKey = keyof I18nNamespaces['common']; -export type I18nCloudProvidersKey = keyof I18nNamespaces['cloudProviders']; -export type I18nErrorKey = keyof I18nNamespaces['error']; +export type I18nCommonKey = NestedKeyOf['common']; +export type I18nCloudProvidersKey = NestedKeyOf['cloudProviders']; +export type I18nErrorKey = NestedKeyOf['error']; + +export type NestedKeyOf = { + [Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object + ? `${Key}.${NestedKeyOf}` + : `${Key}`; +}[keyof ObjectType & (string | number)]; + +export type ParseKeys = { + [K in Ns]: `${K}:${NestedKeyOf}`; +}[Ns]; + +export type I18nKeyFunction = { + (key: Key): Key; +}; declare module 'i18next' { interface CustomTypeOptions { diff --git a/frontend/desktop/src/utils/i18n.ts b/frontend/desktop/src/utils/i18n.ts new file mode 100644 index 00000000000..d076b1a87ca --- /dev/null +++ b/frontend/desktop/src/utils/i18n.ts @@ -0,0 +1,3 @@ +import { I18nKeyFunction } from '../types/i18next'; + +export const i18nT: I18nKeyFunction = (key) => key;