From 007fce2deb73e37deaa48c76591c8421feabf78c Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Wed, 29 Nov 2023 10:56:53 +0800 Subject: [PATCH] system title (#526) --- .../core/module/template/system/classifyQuestion.ts | 3 ++- projects/app/src/components/ChatBox/MessageInput.tsx | 2 ++ .../src/components/{Radio => common/MyRadio}/index.tsx | 3 ++- .../src/components/core/module/DatasetParamsModal.tsx | 2 +- .../module/Flow/components/modules/VariableEdit.tsx | 1 + .../src/components/support/permission/Radio/index.tsx | 2 +- projects/app/src/pages/_app.tsx | 10 +++++----- projects/app/src/pages/api/common/file/uploadImage.ts | 8 ++++++++ .../src/pages/app/detail/components/OutLink/index.tsx | 2 +- .../dataset/detail/components/Import/ImportModal.tsx | 2 +- 10 files changed, 24 insertions(+), 11 deletions(-) rename projects/app/src/components/{Radio => common/MyRadio}/index.tsx (96%) diff --git a/packages/global/core/module/template/system/classifyQuestion.ts b/packages/global/core/module/template/system/classifyQuestion.ts index c8eadf0c3..c86cad937 100644 --- a/packages/global/core/module/template/system/classifyQuestion.ts +++ b/packages/global/core/module/template/system/classifyQuestion.ts @@ -42,7 +42,8 @@ export const ClassifyQuestionModule: FlowModuleTemplateType = { label: '背景知识', description: '你可以添加一些特定内容的介绍,从而更好的识别用户的问题类型。这个内容通常是给模型介绍一个它不知道的内容。', - placeholder: '例如: \n1. Laf 是一个云函数开发平台……\n2. Sealos 是一个集群操作系统', + placeholder: + '例如: \n1. AIGC(人工智能生成内容)是指使用人工智能技术自动或半自动地生成数字内容,如文本、图像、音乐、视频等。\n2. AIGC技术包括但不限于自然语言处理、计算机视觉、机器学习和深度学习。这些技术可以创建新内容或修改现有内容,以满足特定的创意、教育、娱乐或信息需求。', showTargetInApp: true, showTargetInPlugin: true }, diff --git a/projects/app/src/components/ChatBox/MessageInput.tsx b/projects/app/src/components/ChatBox/MessageInput.tsx index d95466b33..8de13741a 100644 --- a/projects/app/src/components/ChatBox/MessageInput.tsx +++ b/projects/app/src/components/ChatBox/MessageInput.tsx @@ -92,6 +92,8 @@ const MessageInput = ({ ); } catch (error) { setFileList((state) => state.filter((item) => item.id !== file.id)); + console.log(error); + toast({ status: 'error', title: t('common.Upload File Failed') diff --git a/projects/app/src/components/Radio/index.tsx b/projects/app/src/components/common/MyRadio/index.tsx similarity index 96% rename from projects/app/src/components/Radio/index.tsx rename to projects/app/src/components/common/MyRadio/index.tsx index 516266687..db0bca123 100644 --- a/projects/app/src/components/Radio/index.tsx +++ b/projects/app/src/components/common/MyRadio/index.tsx @@ -44,7 +44,8 @@ const MyRadio = ({ } : { _hover: { - bg: 'white' + bg: 'myBlue.100', + borderColor: 'myBlue.600' } })} _after={{ diff --git a/projects/app/src/components/core/module/DatasetParamsModal.tsx b/projects/app/src/components/core/module/DatasetParamsModal.tsx index 28bb52686..32055267b 100644 --- a/projects/app/src/components/core/module/DatasetParamsModal.tsx +++ b/projects/app/src/components/core/module/DatasetParamsModal.tsx @@ -11,7 +11,7 @@ import { reRankModelList } from '@/web/common/system/staticData'; import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants'; import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constant'; -import MyRadio from '@/components/Radio'; +import MyRadio from '@/components/common/MyRadio'; type DatasetParamsProps = { similarity?: number; diff --git a/projects/app/src/components/core/module/Flow/components/modules/VariableEdit.tsx b/projects/app/src/components/core/module/Flow/components/modules/VariableEdit.tsx index 1a695ce61..ce0d925ac 100644 --- a/projects/app/src/components/core/module/Flow/components/modules/VariableEdit.tsx +++ b/projects/app/src/components/core/module/Flow/components/modules/VariableEdit.tsx @@ -223,6 +223,7 @@ const VariableEdit = ({ fontWeight: 'bold' } : { + color: 'myGray.600', _hover: { boxShadow: 'md' }, diff --git a/projects/app/src/components/support/permission/Radio/index.tsx b/projects/app/src/components/support/permission/Radio/index.tsx index 6f29bb53a..da5bae434 100644 --- a/projects/app/src/components/support/permission/Radio/index.tsx +++ b/projects/app/src/components/support/permission/Radio/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import MyRadio from '@/components/Radio'; +import MyRadio from '@/components/common/MyRadio'; import { PermissionTypeEnum } from '@fastgpt/global/support/permission/constant'; import { useTranslation } from 'next-i18next'; diff --git a/projects/app/src/pages/_app.tsx b/projects/app/src/pages/_app.tsx index 29dc4ab61..67a7c5b95 100644 --- a/projects/app/src/pages/_app.tsx +++ b/projects/app/src/pages/_app.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import type { AppProps } from 'next/app'; import Script from 'next/script'; import Head from 'next/head'; @@ -39,16 +39,18 @@ function App({ Component, pageProps }: AppProps) { const router = useRouter(); const { hiId } = router.query as { hiId?: string }; const { i18n } = useTranslation(); - const { setLastRoute } = useSystemStore(); const [scripts, setScripts] = useState([]); + const [title, setTitle] = useState(process.env.SYSTEM_NAME || 'AI'); useEffect(() => { // get init data (async () => { const { - feConfigs: { scripts, isPlus } + feConfigs: { scripts, isPlus, systemTitle } } = await clientInitData(); + setTitle(systemTitle || 'FastGPT'); + // log fastgpt !isPlus && console.log( @@ -90,8 +92,6 @@ function App({ Component, pageProps }: AppProps) { hiId && localStorage.setItem('inviterId', hiId); }, [hiId]); - const title = feConfigs?.systemTitle || process.env.SYSTEM_NAME || ''; - return ( <> diff --git a/projects/app/src/pages/api/common/file/uploadImage.ts b/projects/app/src/pages/api/common/file/uploadImage.ts index 8ebe61b09..bf1a42f46 100644 --- a/projects/app/src/pages/api/common/file/uploadImage.ts +++ b/projects/app/src/pages/api/common/file/uploadImage.ts @@ -26,3 +26,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) }); } } + +export const config = { + api: { + bodyParser: { + sizeLimit: '16mb' + } + } +}; diff --git a/projects/app/src/pages/app/detail/components/OutLink/index.tsx b/projects/app/src/pages/app/detail/components/OutLink/index.tsx index c125b435c..cc45f7876 100644 --- a/projects/app/src/pages/app/detail/components/OutLink/index.tsx +++ b/projects/app/src/pages/app/detail/components/OutLink/index.tsx @@ -4,7 +4,7 @@ import { Box, useTheme } from '@chakra-ui/react'; import { OutLinkTypeEnum } from '@fastgpt/global/support/outLink/constant'; import dynamic from 'next/dynamic'; -import MyRadio from '@/components/Radio'; +import MyRadio from '@/components/common/MyRadio'; import Share from './Share'; const API = dynamic(() => import('./API')); diff --git a/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx b/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx index b12481210..c71c95267 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx @@ -1,6 +1,6 @@ import React, { useMemo, useState } from 'react'; import { Box, type BoxProps, Flex, useTheme, ModalCloseButton } from '@chakra-ui/react'; -import MyRadio from '@/components/Radio/index'; +import MyRadio from '@/components/common/MyRadio/index'; import dynamic from 'next/dynamic'; import ChunkImport from './Chunk'; import { useTranslation } from 'next-i18next';