mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
i18n
This commit is contained in:
@@ -10,6 +10,7 @@ import PageContainer from '@/components/PageContainer';
|
||||
import SideTabs from '@/components/SideTabs';
|
||||
import Tabs from '@/components/Tabs';
|
||||
import UserInfo from './components/Info';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
|
||||
const BillTable = dynamic(() => import('./components/BillTable'), {
|
||||
ssr: false
|
||||
@@ -29,7 +30,7 @@ enum TabEnum {
|
||||
'loginout' = 'loginout'
|
||||
}
|
||||
|
||||
const NumberSetting = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
|
||||
const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
|
||||
const tabList = useRef([
|
||||
{ icon: 'meLight', label: '个人信息', id: TabEnum.info, Component: <BillTable /> },
|
||||
{ icon: 'billRecordLight', label: '消费记录', id: TabEnum.bill, Component: <BillTable /> },
|
||||
@@ -115,12 +116,13 @@ const NumberSetting = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export async function getServerSideProps({ query }: any) {
|
||||
export async function getServerSideProps(content: any) {
|
||||
return {
|
||||
props: {
|
||||
currentTab: query?.currentTab || TabEnum.info
|
||||
currentTab: content?.query?.currentTab || TabEnum.info,
|
||||
...(await serviceSideProps(content))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default NumberSetting;
|
||||
export default Account;
|
@@ -14,6 +14,7 @@ import MyIcon from '@/components/Icon';
|
||||
import PageContainer from '@/components/PageContainer';
|
||||
import Loading from '@/components/Loading';
|
||||
import BasicEdit from './components/BasicEdit';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
|
||||
const AdEdit = dynamic(() => import('./components/AdEdit'), {
|
||||
ssr: false,
|
||||
@@ -188,7 +189,7 @@ export async function getServerSideProps(context: any) {
|
||||
const currentTab = context?.query?.currentTab || TabEnum.basicEdit;
|
||||
|
||||
return {
|
||||
props: { currentTab }
|
||||
props: { currentTab, ...(await serviceSideProps(context)) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -16,17 +16,21 @@ import { AddIcon } from '@chakra-ui/icons';
|
||||
import { delModelById } from '@/api/app';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
import { useConfirm } from '@/hooks/useConfirm';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import MyIcon from '@/components/Icon';
|
||||
import PageContainer from '@/components/PageContainer';
|
||||
import Avatar from '@/components/Avatar';
|
||||
const CreateModal = dynamic(() => import('./component/CreateModal'));
|
||||
import styles from './index.module.scss';
|
||||
import MyTooltip from '@/components/MyTooltip';
|
||||
const CreateModal = dynamic(() => import('./component/CreateModal'));
|
||||
|
||||
import styles from './index.module.scss';
|
||||
|
||||
const MyApps = () => {
|
||||
const { toast } = useToast();
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const router = useRouter();
|
||||
const { myApps, loadMyModels } = useUserStore();
|
||||
@@ -69,7 +73,7 @@ const MyApps = () => {
|
||||
<PageContainer>
|
||||
<Flex pt={3} px={5} alignItems={'center'}>
|
||||
<Box flex={1} className="textlg" letterSpacing={1} fontSize={'24px'} fontWeight={'bold'}>
|
||||
我的应用
|
||||
{t('app.My Apps')}
|
||||
</Box>
|
||||
<Button leftIcon={<AddIcon />} variant={'base'} onClick={onOpenCreateModal}>
|
||||
新建
|
||||
@@ -167,4 +171,12 @@ const MyApps = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export async function getServerSideProps(content: any) {
|
||||
return {
|
||||
props: {
|
||||
...(await serviceSideProps(content))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default MyApps;
|
||||
|
@@ -7,6 +7,7 @@ import type { ShareAppItem } from '@/types/app';
|
||||
import { useUserStore } from '@/store/user';
|
||||
import ShareModelList from './components/list';
|
||||
import styles from './index.module.scss';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
|
||||
const modelList = () => {
|
||||
const { Loading } = useLoading();
|
||||
@@ -89,4 +90,12 @@ const modelList = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export async function getServerSideProps(content: any) {
|
||||
return {
|
||||
props: {
|
||||
...(await serviceSideProps(content))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default modelList;
|
||||
|
@@ -17,6 +17,7 @@ import SideTabs from '@/components/SideTabs';
|
||||
import PageContainer from '@/components/PageContainer';
|
||||
import Avatar from '@/components/Avatar';
|
||||
import Info from './components/Info';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
|
||||
const ImportData = dynamic(() => import('./components/Import'), {
|
||||
ssr: false
|
||||
@@ -159,7 +160,7 @@ export async function getServerSideProps(context: any) {
|
||||
const kbId = context?.query?.kbId;
|
||||
|
||||
return {
|
||||
props: { currentTab, kbId }
|
||||
props: { currentTab, kbId, ...(await serviceSideProps(content)) }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -12,6 +12,7 @@ import { useRequest } from '@/hooks/useRequest';
|
||||
import Avatar from '@/components/Avatar';
|
||||
import MyIcon from '@/components/Icon';
|
||||
import Tag from '@/components/Tag';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
|
||||
const Kb = () => {
|
||||
const theme = useTheme();
|
||||
@@ -156,4 +157,12 @@ const Kb = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export async function getServerSideProps(content: any) {
|
||||
return {
|
||||
props: {
|
||||
...(await serviceSideProps(content))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default Kb;
|
||||
|
@@ -4,6 +4,7 @@ import { ChevronRightIcon } from '@chakra-ui/icons';
|
||||
import MyIcon from '@/components/Icon';
|
||||
import { useRouter } from 'next/router';
|
||||
import { feConfigs } from '@/store/static';
|
||||
import { serviceSideProps } from '@/utils/i18n';
|
||||
|
||||
const list = [
|
||||
{
|
||||
@@ -57,4 +58,12 @@ const Tools = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export async function getServerSideProps(content: any) {
|
||||
return {
|
||||
props: {
|
||||
...(await serviceSideProps(content))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default Tools;
|
||||
|
Reference in New Issue
Block a user