Skip to content

Commit 1bda5b5

Browse files
authored
fix: next config (#4207)
* reset package * i18n * update config * i18n * remove log
1 parent 37f4dd3 commit 1bda5b5

File tree

38 files changed

+56
-85
lines changed

38 files changed

+56
-85
lines changed

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/app/next.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ const nextConfig = {
8080
transpilePackages: ['@fastgpt/global', '@fastgpt/web', 'ahooks'],
8181
experimental: {
8282
// 优化 Server Components 的构建和运行,避免不必要的客户端打包。
83-
serverComponentsExternalPackages: ['mongoose', 'pg', '@zilliz/milvus2-sdk-node', 'tiktoken'],
83+
serverComponentsExternalPackages: [
84+
'mongoose',
85+
'pg',
86+
'@zilliz/milvus2-sdk-node',
87+
"tiktoken",
88+
],
8489
outputFileTracingRoot: path.join(__dirname, '../../'),
8590
instrumentationHook: true
8691
}

projects/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"request-ip": "^3.3.0",
6565
"sass": "^1.58.3",
6666
"use-context-selector": "^1.4.4",
67+
"@node-rs/jieba": "2.0.1",
6768
"zustand": "^4.3.5"
6869
},
6970
"devDependencies": {

projects/app/src/pageComponents/app/list/TypeTag.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,32 @@ import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
33
import { useI18n } from '@/web/context/I18n';
44
import MyIcon from '@fastgpt/web/components/common/Icon';
55
import { Box, Flex } from '@chakra-ui/react';
6-
import { i18nT } from '@fastgpt/web/i18n/utils';
6+
import { useTranslation } from 'next-i18next';
77

88
const AppTypeTag = ({ type }: { type: AppTypeEnum }) => {
9+
const { t } = useTranslation();
10+
911
const map = useRef({
1012
[AppTypeEnum.simple]: {
11-
label: i18nT('app:type.Simple bot'),
13+
label: t('app:type.Simple bot'),
1214
icon: 'core/app/type/simple',
1315
bg: '#DBF3FF',
1416
color: '#0884DD'
1517
},
1618
[AppTypeEnum.workflow]: {
17-
label: i18nT('app:type.Workflow bot'),
19+
label: t('app:type.Workflow bot'),
1820
icon: 'core/app/type/workflow',
1921
bg: '#E4E1FC',
2022
color: '#6F5DD7'
2123
},
2224
[AppTypeEnum.plugin]: {
23-
label: i18nT('app:type.Plugin'),
25+
label: t('app:type.Plugin'),
2426
icon: 'core/app/type/plugin',
2527
bg: '#D0F5EE',
2628
color: '#007E7C'
2729
},
2830
[AppTypeEnum.httpPlugin]: {
29-
label: i18nT('app:type.Http plugin'),
31+
label: t('app:type.Http plugin'),
3032
icon: 'core/app/type/httpPlugin',
3133
bg: '#FFE4EE',
3234
color: '#E82F72'

projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Markdown from '@/components/Markdown';
22
import { Box, Flex } from '@chakra-ui/react';
33
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
44
import { Dispatch, MutableRefObject, SetStateAction, useState } from 'react';
5-
import { useTranslation } from 'react-i18next';
5+
import { useTranslation } from 'next-i18next';
66
import MyIcon from '@fastgpt/web/components/common/Icon';
77
import { useCopyData } from '@fastgpt/web/hooks/useCopyData';
88
import InputDataModal from '@/pageComponents/dataset/detail/InputDataModal';

projects/app/src/pageComponents/chat/ChatQuoteList/CollectionQuoteReader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SearchDataResponseItemType } from '@fastgpt/global/core/dataset/type';
33
import { getSourceNameIcon } from '@fastgpt/global/core/dataset/utils';
44
import MyIcon from '@fastgpt/web/components/common/Icon';
55
import { useRouter } from 'next/router';
6-
import { useTranslation } from 'react-i18next';
6+
import { useTranslation } from 'next-i18next';
77
import DownloadButton from './DownloadButton';
88
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
99
import { downloadFetch } from '@/web/common/system/utils';

projects/app/src/pageComponents/chat/ChatQuoteList/DownloadButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import MyMenu from '@fastgpt/web/components/common/MyMenu';
2-
import { useTranslation } from 'react-i18next';
2+
import { useTranslation } from 'next-i18next';
33
import MyIconButton from '@fastgpt/web/components/common/Icon/button';
44

55
const DownloadButton = ({

projects/app/src/pageComponents/chat/ChatQuoteList/QuoteItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon';
44
import ScoreTag from './ScoreTag';
55
import Markdown from '@/components/Markdown';
66
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
7-
import { useTranslation } from 'react-i18next';
7+
import { useTranslation } from 'next-i18next';
88
import { useCopyData } from '@fastgpt/web/hooks/useCopyData';
99

1010
const QuoteItem = ({

projects/app/src/pageComponents/chat/ChatQuoteList/QuoteReader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Box, Flex } from '@chakra-ui/react';
22
import { SearchDataResponseItemType } from '@fastgpt/global/core/dataset/type';
33
import MyIcon from '@fastgpt/web/components/common/Icon';
44
import MyBox from '@fastgpt/web/components/common/MyBox';
5-
import { useTranslation } from 'react-i18next';
5+
import { useTranslation } from 'next-i18next';
66
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
77
import QuoteItem from './QuoteItem';
88
import { useMemo } from 'react';

projects/app/src/pageComponents/chat/ChatQuoteList/ScoreTag.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ScoreItemType, scoreTheme } from '@/components/core/dataset/QuoteItem';
22
import { Box, Flex, Progress } from '@chakra-ui/react';
33
import { SearchScoreTypeMap } from '@fastgpt/global/core/dataset/constants';
44
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
5-
import { useTranslation } from 'react-i18next';
5+
import { useTranslation } from 'next-i18next';
66

77
const ScoreTag = (score: { primaryScore?: ScoreItemType; secondaryScore: ScoreItemType[] }) => {
88
const { t } = useTranslation();

0 commit comments

Comments
 (0)