diff --git a/docSite/content/docs/development/docker.md b/docSite/content/docs/development/docker.md index b4c95b613b51..b454ddc7910d 100644 --- a/docSite/content/docs/development/docker.md +++ b/docSite/content/docs/development/docker.md @@ -108,11 +108,6 @@ curl -O https://raw.githubusercontent.com/labring/FastGPT/main/projects/app/data ```bash # 进入项目目录 cd 项目目录 -# 创建 mongo 密钥 -openssl rand -base64 756 > ./mongodb.key -# 600不行可以用chmod 999 -chmod 600 ./mongodb.key -chown 999:root ./mongodb.key # 启动容器 docker-compose pull docker-compose up -d @@ -128,7 +123,7 @@ docker ps # 进入容器 docker exec -it mongo bash -# 连接数据库 +# 连接数据库(这里要填Mongo的用户名和密码) mongo -u myname -p mypassword --authenticationDatabase admin # 初始化副本集。如果需要外网访问,mongo:27017 可以改成 ip:27017。但是需要同时修改 FastGPT 连接的参数(MONGODB_URI=mongodb://myname:mypassword@mongo:27017/fastgpt?authSource=admin => MONGODB_URI=mongodb://myname:mypassword@ip:27017/fastgpt?authSource=admin) @@ -142,8 +137,58 @@ rs.initiate({ rs.status() ``` +**关于 host: "mongo:27017" 说明** + +1. mongo:27017 代表指向同一个 docker 网络的 mongo 容器的 27017 服务。因此,如果使用该参数,外网是无法访问到数据库的。 +2. ip:27017 (ip替换成公网IP):代表通过你的公网IP进行访问。如果用该方法,同时需要修改 docker-compose 中 mongo 的连接参数,因为默认是用 `mongo:27017` 进行连接。 + ## 五、访问 FastGPT 目前可以通过 `ip:3000` 直接访问(注意防火墙)。登录用户名为 `root`,密码为`docker-compose.yml`环境变量里设置的 `DEFAULT_ROOT_PSW`。 如果需要域名访问,请自行安装并配置 Nginx。 + + +## FAQ + +### Mongo 启动失败 + +docker-compose 示例优化 Mongo 副本集参数,不需要手动创建再挂载。如果无法启动,可以尝试更换下面的脚本: + +1. 终端中执行: + +```bash +openssl rand -base64 756 > ./mongodb.key +chmod 600 ./mongodb.key +chown 999:root ./mongodb.key +``` + +2. 修改 docker-compose.yml: + +```yml +mongo: + # image: mongo:5.0.18 + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云 + container_name: mongo + ports: + - 27017:27017 + networks: + - fastgpt + command: mongod --keyFile /data/mongodb.key --replSet rs0 + environment: + # 默认的用户名和密码,只有首次允许有效 + - MONGO_INITDB_ROOT_USERNAME=myname + - MONGO_INITDB_ROOT_PASSWORD=mypassword + volumes: + - ./mongo/data:/data/db + - ./mongodb.key:/data/mongodb.key +``` + +3. 重启服务 + +```bash +docker-compose down +docker-compose up -d +``` + +4. 进入容器执行副本集合初始化(看上方) \ No newline at end of file diff --git a/docSite/content/docs/development/faq.md b/docSite/content/docs/development/faq.md index b1a78365c70b..f1c6be3ed672 100644 --- a/docSite/content/docs/development/faq.md +++ b/docSite/content/docs/development/faq.md @@ -46,9 +46,14 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并 ### 页面崩溃 1. 关闭翻译 -2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。(95%) +2. 检查配置文件是否正常加载,如果没有正常加载会导致缺失系统信息,在某些操作下会导致空指针。(95%情况,可以F12打开控制台,看具体的空指针情况) 3. 某些api不兼容问题(较少) +### 开启内容补全后,响应速度变慢 + +1. 问题补全需要经过一轮AI生成。 +2. 会进行3~5轮的查询,如果数据库性能不足,会有明显影响。 + ## 私有部署问题 ### 知识库索引没有进度 @@ -80,7 +85,7 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并 ### 如何自定义配置文件? -修改`config.json`文件,并执行`docker-compose up -d`重起容器。具体配置,参考[配置详解](/docs/development/configuration)。 +修改`config.json`文件,并执行`docker-compose down`再执行`docker-compose up -d`重起容器。具体配置,参考[配置详解](/docs/development/configuration)。 ### 如何检查自定义配置文件是否挂载 @@ -93,6 +98,12 @@ OneAPI 的 API Key 配置错误,需要修改`OPENAI_API_KEY`环境变量,并 2. 配置文件不正确,日志中会提示`invalid json`,配置文件需要是标准的 JSON 文件。 3. 修改后,没有`docker-compose down`再`docker-compose up -d`,restart是不会重新挂载文件的。 +### 如何检查环境变量是否正常加载 + +1. `docker exec -it fastgpt sh` 进入 FastGPT 容器。 +2. 直接输入`env`命令查看所有环境变量。 + + ### 为什么无法连接`本地模型`镜像。 `docker-compose.yml`中使用了桥接的模式建立了`fastgpt`网络,如想通过0.0.0.0或镜像名访问其它镜像,需将其它镜像也加入到网络中。 diff --git a/docSite/content/docs/development/upgrading/469.md b/docSite/content/docs/development/upgrading/469.md index da4eda4784a3..7539a5ce7626 100644 --- a/docSite/content/docs/development/upgrading/469.md +++ b/docSite/content/docs/development/upgrading/469.md @@ -1,5 +1,5 @@ --- -title: 'V4.6.9(进行中)' +title: 'V4.6.9' description: 'FastGPT V4.6.9更新说明' icon: 'upgrade' draft: false diff --git a/files/deploy/fastgpt/docker-compose.yml b/files/deploy/fastgpt/docker-compose.yml index ab9ce27b1039..fa485dd8e13a 100644 --- a/files/deploy/fastgpt/docker-compose.yml +++ b/files/deploy/fastgpt/docker-compose.yml @@ -19,21 +19,27 @@ services: volumes: - ./pg/data:/var/lib/postgresql/data mongo: - image: mongo:5.0.18 - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云 + image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 container_name: mongo + restart: always ports: - 27017:27017 networks: - fastgpt command: mongod --keyFile /data/mongodb.key --replSet rs0 environment: - # 默认的用户名和密码,只有首次允许有效 - - MONGO_INITDB_ROOT_USERNAME=myname + - MONGO_INITDB_ROOT_USERNAME=myusername - MONGO_INITDB_ROOT_PASSWORD=mypassword volumes: - ./mongo/data:/data/db - - ./mongodb.key:/data/mongodb.key + entrypoint: + - bash + - -c + - | + openssl rand -base64 128 > /data/mongodb.key + chmod 400 /data/mongodb.key + chown 999:999 /data/mongodb.key + exec docker-entrypoint.sh $$@ fastgpt: container_name: fastgpt image: ghcr.io/labring/fastgpt:latest # git diff --git a/packages/global/common/system/types/index.d.ts b/packages/global/common/system/types/index.d.ts index fda136277af8..94abbd74ac66 100644 --- a/packages/global/common/system/types/index.d.ts +++ b/packages/global/common/system/types/index.d.ts @@ -63,6 +63,8 @@ export type SystemEnvType = { vectorMaxProcess: number; qaMaxProcess: number; pgHNSWEfSearch: number; + oneapiUrl?: string; + chatApiKey?: string; }; // declare global { diff --git a/packages/global/support/wallet/bill/type.d.ts b/packages/global/support/wallet/bill/type.d.ts index 17d15d58bad2..89a4afdaa66b 100644 --- a/packages/global/support/wallet/bill/type.d.ts +++ b/packages/global/support/wallet/bill/type.d.ts @@ -19,6 +19,7 @@ export type BillSchemaType = { datasetSize?: number; extraPoints?: number; }; + username: string; }; export type ChatModuleUsageType = { diff --git a/packages/service/core/ai/config.ts b/packages/service/core/ai/config.ts index 17aff89aa15c..3662b1fa3e14 100644 --- a/packages/service/core/ai/config.ts +++ b/packages/service/core/ai/config.ts @@ -2,9 +2,9 @@ import type { UserModelSchema } from '@fastgpt/global/support/user/type'; import OpenAI from '@fastgpt/global/core/ai'; export const openaiBaseUrl = process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1'; -export const baseUrl = process.env.ONEAPI_URL || openaiBaseUrl; +export const baseUrl = global?.systemEnv?.oneapiUrl || process.env.ONEAPI_URL || openaiBaseUrl; -export const systemAIChatKey = process.env.CHAT_API_KEY || ''; +export const systemAIChatKey = global?.systemEnv?.chatApiKey || process.env.CHAT_API_KEY || ''; export const getAIApi = (props?: { userKey?: UserModelSchema['openaiAccount']; diff --git a/projects/app/src/components/DateRangePicker/index.tsx b/packages/web/components/common/DateRangePicker/index.tsx similarity index 98% rename from projects/app/src/components/DateRangePicker/index.tsx rename to packages/web/components/common/DateRangePicker/index.tsx index 9b61d648d32c..ce9dfe81dc2d 100644 --- a/projects/app/src/components/DateRangePicker/index.tsx +++ b/packages/web/components/common/DateRangePicker/index.tsx @@ -2,10 +2,10 @@ import React, { useState, useMemo, useRef } from 'react'; import { Box, Card, Flex, useTheme, useOutsideClick, Button } from '@chakra-ui/react'; import { addDays, format } from 'date-fns'; import { type DateRange, DayPicker } from 'react-day-picker'; -import MyIcon from '@fastgpt/web/components/common/Icon'; import 'react-day-picker/dist/style.css'; import zhCN from 'date-fns/locale/zh-CN'; import { useTranslation } from 'next-i18next'; +import MyIcon from '../Icon'; const DateRangePicker = ({ onChange, diff --git a/projects/app/src/components/Loading/index.tsx b/packages/web/components/common/MyLoading/index.tsx similarity index 100% rename from projects/app/src/components/Loading/index.tsx rename to packages/web/components/common/MyLoading/index.tsx diff --git a/projects/app/src/components/Select/index.tsx b/packages/web/components/common/MySelect/index.tsx similarity index 100% rename from projects/app/src/components/Select/index.tsx rename to packages/web/components/common/MySelect/index.tsx diff --git a/projects/app/src/web/common/hooks/useLoading.tsx b/packages/web/hooks/useLoading.tsx similarity index 91% rename from projects/app/src/web/common/hooks/useLoading.tsx rename to packages/web/hooks/useLoading.tsx index 9a3c581bd4b5..23bb7d4bb9eb 100644 --- a/projects/app/src/web/common/hooks/useLoading.tsx +++ b/packages/web/hooks/useLoading.tsx @@ -1,5 +1,5 @@ import { useState, useCallback } from 'react'; -import LoadingComponent from '@/components/Loading'; +import LoadingComponent from '../components/common/MyLoading'; export const useLoading = (props?: { defaultLoading: boolean }) => { const [isLoading, setIsLoading] = useState(props?.defaultLoading || false); diff --git a/projects/app/src/web/common/hooks/usePagination.tsx b/packages/web/hooks/usePagination.tsx similarity index 81% rename from projects/app/src/web/common/hooks/usePagination.tsx rename to packages/web/hooks/usePagination.tsx index d5a6e4c765b7..be273341b69a 100644 --- a/projects/app/src/web/common/hooks/usePagination.tsx +++ b/packages/web/hooks/usePagination.tsx @@ -1,20 +1,28 @@ import { useRef, useState, useCallback, useMemo, useEffect } from 'react'; -import type { PagingData } from '@/types/index.d'; import { IconButton, Flex, Box, Input } from '@chakra-ui/react'; import { ArrowBackIcon, ArrowForwardIcon } from '@chakra-ui/icons'; import { useMutation } from '@tanstack/react-query'; -import { useToast } from '@fastgpt/web/hooks/useToast'; + import { throttle } from 'lodash'; +import { useToast } from './useToast'; const thresholdVal = 100; +type PagingData = { + pageNum: number; + pageSize: number; + data: T[]; + total?: number; +}; + export function usePagination({ api, pageSize = 10, params = {}, defaultRequest = true, type = 'button', - onChange + onChange, + elementRef }: { api: (data: any) => any; pageSize?: number; @@ -22,12 +30,18 @@ export function usePagination({ defaultRequest?: boolean; type?: 'button' | 'scroll'; onChange?: (pageNum: number) => void; + elementRef?: React.RefObject; }) { - const elementRef = useRef(null); const { toast } = useToast(); const [pageNum, setPageNum] = useState(1); + const pageNumRef = useRef(pageNum); + pageNumRef.current = pageNum; const [total, setTotal] = useState(0); + const totalRef = useRef(total); + totalRef.current = total; const [data, setData] = useState([]); + const dataLengthRef = useRef(data.length); + dataLengthRef.current = data.length; const maxPage = useMemo(() => Math.ceil(total / pageSize) || 1, [pageSize, total]); const { mutate, isLoading } = useMutation({ @@ -40,7 +54,11 @@ export function usePagination({ }); setPageNum(num); res.total !== undefined && setTotal(res.total); - setData(res.data); + if (type === 'scroll') { + setData((prevData) => [...prevData, ...res.data]); + } else { + setData(res.data); + } onChange && onChange(num); } catch (error: any) { toast({ @@ -147,7 +165,7 @@ export function usePagination({ ); useEffect(() => { - if (!elementRef.current || type !== 'scroll') return; + if (!elementRef?.current || type !== 'scroll') return; const scrolling = throttle((e: Event) => { const element = e.target as HTMLDivElement; @@ -159,16 +177,23 @@ export function usePagination({ // 内容总高度 const scrollHeight = element.scrollHeight; // 判断是否滚动到底部 - if (scrollTop + clientHeight + thresholdVal >= scrollHeight) { - mutate(pageNum + 1); + if ( + scrollTop + clientHeight + thresholdVal >= scrollHeight && + dataLengthRef.current < totalRef.current + ) { + mutate(pageNumRef.current + 1); } }, 100); - elementRef.current.addEventListener('scroll', scrolling); + + const handleScroll = (e: Event) => { + scrolling(e); + }; + + elementRef.current.addEventListener('scroll', handleScroll); return () => { - // eslint-disable-next-line react-hooks/exhaustive-deps - elementRef.current?.removeEventListener('scroll', scrolling); + elementRef.current?.removeEventListener('scroll', handleScroll); }; - }, [elementRef, mutate, pageNum, type]); + }, [elementRef, mutate, pageNum, type, total, data.length]); useEffect(() => { defaultRequest && mutate(1); @@ -179,6 +204,7 @@ export function usePagination({ pageSize, total, data, + setData, isLoading, Pagination, ScrollData, diff --git a/packages/web/package.json b/packages/web/package.json index 39ab14d8eab8..f7142e58f4b4 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -26,9 +26,15 @@ "@lexical/react": "0.12.6", "papaparse": "^5.4.1", "@lexical/utils": "0.12.6", - "@lexical/text": "0.12.6" + "@lexical/text": "0.12.6", + "date-fns": "2.30.0", + "react-day-picker": "^8.7.1", + "lodash": "^4.17.21", + "@tanstack/react-query": "^4.24.10", + "dayjs": "^1.11.7" }, "devDependencies": { + "@types/lodash": "^4.14.191", "@types/react": "18.2.0", "@types/papaparse": "^5.3.7", "@types/react-dom": "18.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 36e7148acf1a..3e7caaf7d0ba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -184,6 +184,15 @@ importers: '@monaco-editor/react': specifier: ^4.6.0 version: 4.6.0(monaco-editor@0.46.0)(react-dom@18.2.0)(react@18.2.0) + '@tanstack/react-query': + specifier: ^4.24.10 + version: 4.24.10(react-dom@18.2.0)(react@18.2.0) + date-fns: + specifier: 2.30.0 + version: 2.30.0 + dayjs: + specifier: ^1.11.7 + version: 1.11.7 i18next: specifier: 23.10.0 version: 23.10.0 @@ -193,6 +202,9 @@ importers: lexical: specifier: 0.12.6 version: 0.12.6 + lodash: + specifier: ^4.17.21 + version: 4.17.21 mammoth: specifier: ^1.6.0 version: 1.6.0 @@ -208,6 +220,9 @@ importers: react: specifier: 18.2.0 version: 18.2.0 + react-day-picker: + specifier: ^8.7.1 + version: 8.7.1(date-fns@2.30.0)(react@18.2.0) react-dom: specifier: 18.2.0 version: 18.2.0(react@18.2.0) @@ -218,6 +233,9 @@ importers: specifier: ^7.1.2 version: 7.1.2 devDependencies: + '@types/lodash': + specifier: ^4.14.191 + version: 4.14.191 '@types/papaparse': specifier: ^5.3.7 version: 5.3.7 @@ -2886,6 +2904,7 @@ packages: /@emotion/memoize@0.7.4: resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} + requiresBuild: true dev: false optional: true @@ -3486,6 +3505,7 @@ packages: /@mapbox/node-pre-gyp@1.0.11: resolution: {integrity: sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==} hasBin: true + requiresBuild: true dependencies: detect-libc: 2.0.2 https-proxy-agent: 5.0.1 @@ -4631,6 +4651,7 @@ packages: /abbrev@1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + requiresBuild: true dev: false optional: true @@ -4666,6 +4687,7 @@ packages: /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} + requiresBuild: true dependencies: debug: 4.3.4 transitivePeerDependencies: @@ -4744,12 +4766,14 @@ packages: /aproba@2.0.0: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} + requiresBuild: true dev: false optional: true /are-we-there-yet@2.0.0: resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==} engines: {node: '>=10'} + requiresBuild: true dependencies: delegates: 1.0.0 readable-stream: 3.6.2 @@ -5326,6 +5350,7 @@ packages: /chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} + requiresBuild: true dev: false optional: true @@ -5433,6 +5458,7 @@ packages: /color-support@1.1.3: resolution: {integrity: sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==} hasBin: true + requiresBuild: true dev: false optional: true @@ -5501,6 +5527,7 @@ packages: /console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} + requiresBuild: true dev: false optional: true @@ -6033,6 +6060,7 @@ packages: /decompress-response@4.2.1: resolution: {integrity: sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==} engines: {node: '>=8'} + requiresBuild: true dependencies: mimic-response: 2.1.0 dev: false @@ -6084,6 +6112,7 @@ packages: /delegates@1.0.0: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} + requiresBuild: true dev: false optional: true @@ -6111,6 +6140,7 @@ packages: /detect-libc@2.0.2: resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==} engines: {node: '>=8'} + requiresBuild: true dev: false optional: true @@ -7242,6 +7272,7 @@ packages: /fs-minipass@2.1.0: resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} engines: {node: '>= 8'} + requiresBuild: true dependencies: minipass: 3.3.6 dev: false @@ -7277,6 +7308,7 @@ packages: /gauge@3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} engines: {node: '>=10'} + requiresBuild: true dependencies: aproba: 2.0.0 color-support: 1.1.3 @@ -7447,6 +7479,7 @@ packages: /has-unicode@2.0.1: resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==} + requiresBuild: true dev: false optional: true @@ -7596,6 +7629,7 @@ packages: /https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} + requiresBuild: true dependencies: agent-base: 6.0.2 debug: 4.3.4 @@ -8362,6 +8396,7 @@ packages: /make-dir@3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} + requiresBuild: true dependencies: semver: 6.3.1 dev: false @@ -8565,6 +8600,7 @@ packages: /memory-pager@1.5.0: resolution: {integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==} + requiresBuild: true dev: false optional: true @@ -8916,6 +8952,7 @@ packages: /mimic-response@2.1.0: resolution: {integrity: sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==} engines: {node: '>=8'} + requiresBuild: true dev: false optional: true @@ -8938,6 +8975,7 @@ packages: /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} + requiresBuild: true dependencies: yallist: 4.0.0 dev: false @@ -8946,12 +8984,14 @@ packages: /minipass@5.0.0: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} + requiresBuild: true dev: false optional: true /minizlib@2.1.2: resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} engines: {node: '>= 8'} + requiresBuild: true dependencies: minipass: 3.3.6 yallist: 4.0.0 @@ -8969,6 +9009,7 @@ packages: resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} engines: {node: '>=10'} hasBin: true + requiresBuild: true dev: false optional: true @@ -9067,6 +9108,7 @@ packages: /nan@2.18.0: resolution: {integrity: sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==} + requiresBuild: true dev: false optional: true @@ -9227,6 +9269,7 @@ packages: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} hasBin: true + requiresBuild: true dependencies: abbrev: 1.1.1 dev: false @@ -9245,6 +9288,7 @@ packages: /npmlog@5.0.1: resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + requiresBuild: true dependencies: are-we-there-yet: 2.0.0 console-control-strings: 1.1.0 @@ -10420,6 +10464,7 @@ packages: /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + requiresBuild: true dev: false optional: true @@ -10489,11 +10534,13 @@ packages: /simple-concat@1.0.1: resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + requiresBuild: true dev: false optional: true /simple-get@3.1.1: resolution: {integrity: sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==} + requiresBuild: true dependencies: decompress-response: 4.2.1 once: 1.4.0 @@ -10569,6 +10616,7 @@ packages: /sparse-bitfield@3.0.3: resolution: {integrity: sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==} + requiresBuild: true dependencies: memory-pager: 1.5.0 dev: false @@ -10799,6 +10847,7 @@ packages: /tar@6.2.0: resolution: {integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==} engines: {node: '>=10'} + requiresBuild: true dependencies: chownr: 2.0.0 fs-minipass: 2.1.0 @@ -11529,6 +11578,7 @@ packages: /wide-align@1.1.5: resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + requiresBuild: true dependencies: string-width: 4.2.3 dev: false diff --git a/projects/app/public/docs/versionIntro.md b/projects/app/public/docs/versionIntro.md index ab085da11940..166d0c410b90 100644 --- a/projects/app/public/docs/versionIntro.md +++ b/projects/app/public/docs/versionIntro.md @@ -1,4 +1,4 @@ -### Fast GPT V4.6.8 +### Fast GPT V4.6.9 1. 新增 - 知识库新增“增强处理”训练模式,可生成更多类型索引。 2. 新增 - 完善了HTTP模块的变量提示。 diff --git a/projects/app/src/components/ChatBox/index.tsx b/projects/app/src/components/ChatBox/index.tsx index 076dca504e63..c1afc6120d73 100644 --- a/projects/app/src/components/ChatBox/index.tsx +++ b/projects/app/src/components/ChatBox/index.tsx @@ -53,7 +53,6 @@ import type { AdminMarkType } from './SelectMarkCollection'; import MyIcon from '@fastgpt/web/components/common/Icon'; import Avatar from '@/components/Avatar'; import Markdown, { CodeClassName } from '@/components/Markdown'; -import MySelect from '@/components/Select'; import MyTooltip from '../MyTooltip'; import dynamic from 'next/dynamic'; const ResponseTags = dynamic(() => import('./ResponseTags')); @@ -69,6 +68,7 @@ import MessageInput from './MessageInput'; import { ModuleOutputKeyEnum } from '@fastgpt/global/core/module/constants'; import ChatBoxDivider from '../core/chat/Divider'; import { OutLinkChatAuthProps } from '@fastgpt/global/support/permission/chat'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 24); diff --git a/projects/app/src/components/Layout/index.tsx b/projects/app/src/components/Layout/index.tsx index 2762c56788f0..d02e6029e32b 100644 --- a/projects/app/src/components/Layout/index.tsx +++ b/projects/app/src/components/Layout/index.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useMemo } from 'react'; import { Box, useColorMode, Flex } from '@chakra-ui/react'; import { useRouter } from 'next/router'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import { throttle } from 'lodash'; import { useQuery } from '@tanstack/react-query'; diff --git a/projects/app/src/components/Select/SelectAiModel.tsx b/projects/app/src/components/Select/SelectAiModel.tsx index 328128f224fa..222e9a506006 100644 --- a/projects/app/src/components/Select/SelectAiModel.tsx +++ b/projects/app/src/components/Select/SelectAiModel.tsx @@ -1,10 +1,10 @@ import React, { useMemo } from 'react'; -import MySelect, { type SelectProps } from './index'; import { useTranslation } from 'next-i18next'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useRouter } from 'next/router'; import { AI_POINT_USAGE_CARD_ROUTE } from '@/web/support/wallet/sub/constants'; +import MySelect, { SelectProps } from '@fastgpt/web/components/common/MySelect'; const SelectAiModel = ({ list, ...props }: SelectProps) => { const { t } = useTranslation(); diff --git a/projects/app/src/components/common/MyBox/index.tsx b/projects/app/src/components/common/MyBox/index.tsx index e11ec6d26cb7..6f296b30a67e 100644 --- a/projects/app/src/components/common/MyBox/index.tsx +++ b/projects/app/src/components/common/MyBox/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Box, BoxProps } from '@chakra-ui/react'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; type Props = BoxProps & { isLoading?: boolean; diff --git a/projects/app/src/components/core/module/DatasetParamsModal.tsx b/projects/app/src/components/core/module/DatasetParamsModal.tsx index 76384f65d89d..324798ebf782 100644 --- a/projects/app/src/components/core/module/DatasetParamsModal.tsx +++ b/projects/app/src/components/core/module/DatasetParamsModal.tsx @@ -26,9 +26,9 @@ import MyRadio from '@/components/common/MyRadio'; import MyIcon from '@fastgpt/web/components/common/Icon'; import Tabs from '@/components/Tabs'; import PromptEditor from '@fastgpt/web/components/common/Textarea/PromptEditor'; -import SelectAiModel from '@/components/Select/SelectAiModel'; import { useUserStore } from '@/web/support/user/useUserStore'; import { useToast } from '@fastgpt/web/hooks/useToast'; +import SelectAiModel from '@/components/Select/SelectAiModel'; export type DatasetParamsProps = { searchMode: `${DatasetSearchModeEnum}`; diff --git a/projects/app/src/components/core/module/DatasetSelectModal.tsx b/projects/app/src/components/core/module/DatasetSelectModal.tsx index a543ad7d07f2..a57a07ffe6f6 100644 --- a/projects/app/src/components/core/module/DatasetSelectModal.tsx +++ b/projects/app/src/components/core/module/DatasetSelectModal.tsx @@ -19,7 +19,7 @@ import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constants'; import { useTranslation } from 'next-i18next'; import { useDatasetStore } from '@/web/core/dataset/store/dataset'; import DatasetSelectContainer, { useDatasetSelect } from '@/components/core/dataset/SelectModal'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import EmptyTip from '@/components/EmptyTip'; export const DatasetSelectModal = ({ diff --git a/projects/app/src/components/core/module/Flow/FlowProvider.tsx b/projects/app/src/components/core/module/Flow/FlowProvider.tsx index e3cbb182591c..fa82ed22d119 100644 --- a/projects/app/src/components/core/module/Flow/FlowProvider.tsx +++ b/projects/app/src/components/core/module/Flow/FlowProvider.tsx @@ -177,7 +177,11 @@ export const FlowProvider = ({ ({ connect }: { connect: Connection }) => { const source = nodes.find((node) => node.id === connect.source)?.data; const sourceType = (() => { - if (source?.flowType === FlowNodeTypeEnum.classifyQuestion) { + const type = source?.outputs.find( + (output) => output.key === connect.sourceHandle + )?.valueType; + console.log(type); + if (source?.flowType === FlowNodeTypeEnum.classifyQuestion && !type) { return ModuleIOValueTypeEnum.boolean; } if (source?.flowType === FlowNodeTypeEnum.pluginInput) { diff --git a/projects/app/src/components/core/module/Flow/SelectAppModal.tsx b/projects/app/src/components/core/module/Flow/SelectAppModal.tsx index 4485b73a3acf..c0c90c25c058 100644 --- a/projects/app/src/components/core/module/Flow/SelectAppModal.tsx +++ b/projects/app/src/components/core/module/Flow/SelectAppModal.tsx @@ -5,7 +5,7 @@ import { useQuery } from '@tanstack/react-query'; import type { SelectAppItemType } from '@fastgpt/global/core/module/type'; import Avatar from '@/components/Avatar'; import { useTranslation } from 'next-i18next'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import { useAppStore } from '@/web/core/app/store/useAppStore'; const SelectAppModal = ({ diff --git a/projects/app/src/components/core/module/Flow/components/modules/TTSSelect.tsx b/projects/app/src/components/core/module/Flow/components/modules/TTSSelect.tsx index 718707f16e17..c62c26e2cfbe 100644 --- a/projects/app/src/components/core/module/Flow/components/modules/TTSSelect.tsx +++ b/projects/app/src/components/core/module/Flow/components/modules/TTSSelect.tsx @@ -4,13 +4,13 @@ import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { Box, Button, Flex, ModalBody, useDisclosure, Image } from '@chakra-ui/react'; import React, { useCallback, useMemo } from 'react'; import { useTranslation } from 'next-i18next'; -import MySelect from '@/components/Select'; import { TTSTypeEnum } from '@/constants/app'; import type { AppTTSConfigType } from '@fastgpt/global/core/module/type.d'; import { useAudioPlay } from '@/web/common/utils/voice'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import MyModal from '@/components/MyModal'; import MySlider from '@/components/Slider'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const TTSSelect = ({ value, diff --git a/projects/app/src/components/core/module/Flow/components/nodes/NodeHttp/index.tsx b/projects/app/src/components/core/module/Flow/components/nodes/NodeHttp/index.tsx index 97e7f9072dee..e20924e4757c 100644 --- a/projects/app/src/components/core/module/Flow/components/nodes/NodeHttp/index.tsx +++ b/projects/app/src/components/core/module/Flow/components/nodes/NodeHttp/index.tsx @@ -19,7 +19,6 @@ import { TableContainer, Button } from '@chakra-ui/react'; -import MySelect from '@/components/Select'; import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants'; import { onChangeNode, useFlowProviderStore } from '../../../FlowProvider'; import { useTranslation } from 'next-i18next'; @@ -38,6 +37,7 @@ import { import { EditorVariablePickerType } from '@fastgpt/web/components/common/Textarea/PromptEditor/type'; import HttpInput from '@fastgpt/web/components/common/Input/HttpInput'; import dynamic from 'next/dynamic'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const OpenApiImportModal = dynamic(() => import('./OpenApiImportModal')); enum TabEnum { diff --git a/projects/app/src/components/core/module/Flow/components/render/FieldEditModal.tsx b/projects/app/src/components/core/module/Flow/components/render/FieldEditModal.tsx index 3397a85b4b10..74038243ff36 100644 --- a/projects/app/src/components/core/module/Flow/components/render/FieldEditModal.tsx +++ b/projects/app/src/components/core/module/Flow/components/render/FieldEditModal.tsx @@ -13,7 +13,6 @@ import { useForm } from 'react-hook-form'; import MyModal from '@/components/MyModal'; import { DYNAMIC_INPUT_KEY, ModuleIOValueTypeEnum } from '@fastgpt/global/core/module/constants'; import { useTranslation } from 'next-i18next'; -import MySelect from '@/components/Select'; import { FlowValueTypeMap } from '@/web/core/modules/constants/dataType'; import { FlowNodeInputTypeEnum, @@ -21,6 +20,7 @@ import { } from '@fastgpt/global/core/module/node/constant'; import { EditInputFieldMap, EditNodeFieldType } from '@fastgpt/global/core/module/node/type.d'; import { useToast } from '@fastgpt/web/hooks/useToast'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const FieldEditModal = ({ editField = { diff --git a/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/Select.tsx b/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/Select.tsx index a6cc4fba2d71..759655d971b1 100644 --- a/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/Select.tsx +++ b/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/Select.tsx @@ -1,7 +1,7 @@ import React from 'react'; import type { RenderInputProps } from '../type'; import { onChangeNode } from '../../../../FlowProvider'; -import MySelect from '@/components/Select'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const SelectRender = ({ item, moduleId }: RenderInputProps) => { return ( diff --git a/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/SelectAiModel.tsx b/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/SelectAiModel.tsx index 07fe7c1ba687..502daa684130 100644 --- a/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/SelectAiModel.tsx +++ b/projects/app/src/components/core/module/Flow/components/render/RenderInput/templates/SelectAiModel.tsx @@ -1,8 +1,8 @@ import React, { useCallback, useEffect } from 'react'; import type { RenderInputProps } from '../type'; import { onChangeNode } from '../../../../FlowProvider'; -import SelectAiModel from '@/components/Select/SelectAiModel'; import { useSystemStore } from '@/web/common/system/useSystemStore'; +import SelectAiModel from '@/components/Select/SelectAiModel'; const SelectAiModelRender = ({ item, inputs = [], moduleId }: RenderInputProps) => { const { llmModelList } = useSystemStore(); diff --git a/projects/app/src/components/support/apikey/Table.tsx b/projects/app/src/components/support/apikey/Table.tsx index bb37d89bc1cc..b8820d820eed 100644 --- a/projects/app/src/components/support/apikey/Table.tsx +++ b/projects/app/src/components/support/apikey/Table.tsx @@ -28,7 +28,7 @@ import { } from '@/web/support/openapi/api'; import type { EditApiKeyProps } from '@/global/support/openapi/api.d'; import { useQuery, useMutation } from '@tanstack/react-query'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import dayjs from 'dayjs'; import { AddIcon, QuestionOutlineIcon } from '@chakra-ui/icons'; import { useCopyData } from '@/web/common/hooks/useCopyData'; diff --git a/projects/app/src/components/support/user/team/TeamManageModal/InviteModal.tsx b/projects/app/src/components/support/user/team/TeamManageModal/InviteModal.tsx index 58e53d72ec08..536fcc2ef87b 100644 --- a/projects/app/src/components/support/user/team/TeamManageModal/InviteModal.tsx +++ b/projects/app/src/components/support/user/team/TeamManageModal/InviteModal.tsx @@ -3,12 +3,12 @@ import MyModal from '@/components/MyModal'; import { useTranslation } from 'next-i18next'; import { ModalCloseButton, ModalBody, Box, ModalFooter, Button } from '@chakra-ui/react'; import TagTextarea from '@/components/common/Textarea/TagTextarea'; -import MySelect from '@/components/Select'; import { TeamMemberRoleEnum } from '@fastgpt/global/support/user/team/constant'; import { useRequest } from '@/web/common/hooks/useRequest'; import { postInviteTeamMember } from '@/web/support/user/team/api'; import { useConfirm } from '@/web/common/hooks/useConfirm'; import type { InviteMemberResponse } from '@fastgpt/global/support/user/team/controller.d'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const InviteModal = ({ teamId, diff --git a/projects/app/src/components/support/user/team/TeamManageModal/index.tsx b/projects/app/src/components/support/user/team/TeamManageModal/index.tsx index ac345add66d1..d4b542044f19 100644 --- a/projects/app/src/components/support/user/team/TeamManageModal/index.tsx +++ b/projects/app/src/components/support/user/team/TeamManageModal/index.tsx @@ -38,7 +38,7 @@ import { import dynamic from 'next/dynamic'; import { useRequest } from '@/web/common/hooks/useRequest'; import { setToken } from '@/web/support/user/auth'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import { FormDataType, defaultForm } from './EditModal'; import MyMenu from '@/components/MyMenu'; import { useConfirm } from '@/web/common/hooks/useConfirm'; diff --git a/projects/app/src/pages/account/components/BillTable.tsx b/projects/app/src/pages/account/components/BillTable.tsx index e5c20dce08fe..ad394837ac74 100644 --- a/projects/app/src/pages/account/components/BillTable.tsx +++ b/projects/app/src/pages/account/components/BillTable.tsx @@ -19,18 +19,19 @@ import { formatStorePrice2Read } from '@fastgpt/global/support/wallet/usage/tool import { useToast } from '@fastgpt/web/hooks/useToast'; import MyIcon from '@fastgpt/web/components/common/Icon'; import { useTranslation } from 'next-i18next'; -import MySelect from '@/components/Select'; import { BillTypeEnum, billPayWayMap, billStatusMap, billTypeMap } from '@fastgpt/global/support/wallet/bill/constants'; -import { usePagination } from '@/web/common/hooks/usePagination'; +// import { usePagination } from '@/web/common/hooks/usePagination'; import MyBox from '@/components/common/MyBox'; import { useRequest } from '@/web/common/hooks/useRequest'; -import MyModal from '@/components/MyModal'; import { standardSubLevelMap, subModeMap } from '@fastgpt/global/support/wallet/sub/constants'; +import MySelect from '@fastgpt/web/components/common/MySelect'; +import MyModal from '@fastgpt/web/components/common/CustomModal'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; const BillTable = () => { const { t } = useTranslation(); diff --git a/projects/app/src/pages/account/components/Individuation.tsx b/projects/app/src/pages/account/components/Individuation.tsx index 9ac344b573a9..545a80231812 100644 --- a/projects/app/src/pages/account/components/Individuation.tsx +++ b/projects/app/src/pages/account/components/Individuation.tsx @@ -9,8 +9,8 @@ import { useToast } from '@fastgpt/web/hooks/useToast'; import { useForm } from 'react-hook-form'; import { UserUpdateParams } from '@/types/user'; import { langMap, setLngStore } from '@/web/common/utils/i18n'; -import MySelect from '@/components/Select'; import { useRouter } from 'next/router'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const Individuation = () => { const { t, i18n } = useTranslation(); diff --git a/projects/app/src/pages/account/components/InformTable.tsx b/projects/app/src/pages/account/components/InformTable.tsx index 9602300535d3..02720a047133 100644 --- a/projects/app/src/pages/account/components/InformTable.tsx +++ b/projects/app/src/pages/account/components/InformTable.tsx @@ -1,12 +1,12 @@ import React from 'react'; import { Box, Flex, useTheme } from '@chakra-ui/react'; import { getInforms, readInform } from '@/web/support/user/inform/api'; -import { usePagination } from '@/web/common/hooks/usePagination'; -import { useLoading } from '@/web/common/hooks/useLoading'; import type { UserInformSchema } from '@fastgpt/global/support/user/inform/type'; import { formatTimeToChatTime } from '@/utils/tools'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import MyIcon from '@fastgpt/web/components/common/Icon'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; const BillTable = () => { const theme = useTheme(); diff --git a/projects/app/src/pages/account/components/Promotion.tsx b/projects/app/src/pages/account/components/Promotion.tsx index e1e22fb40c70..abef3798787a 100644 --- a/projects/app/src/pages/account/components/Promotion.tsx +++ b/projects/app/src/pages/account/components/Promotion.tsx @@ -18,15 +18,15 @@ import { useTranslation } from 'next-i18next'; import { useQuery } from '@tanstack/react-query'; import { getPromotionInitData, getPromotionRecords } from '@/web/support/activity/promotion/api'; import { useUserStore } from '@/web/support/user/useUserStore'; -import { useLoading } from '@/web/common/hooks/useLoading'; import MyTooltip from '@/components/MyTooltip'; import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { useCopyData } from '@/web/common/hooks/useCopyData'; -import { usePagination } from '@/web/common/hooks/usePagination'; import type { PromotionRecordType } from '@/global/support/api/userRes.d'; import MyIcon from '@fastgpt/web/components/common/Icon'; import dayjs from 'dayjs'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; const Promotion = () => { const { t } = useTranslation(); diff --git a/projects/app/src/pages/account/components/UsageTable.tsx b/projects/app/src/pages/account/components/UsageTable.tsx index d73f779def61..722f4b35a275 100644 --- a/projects/app/src/pages/account/components/UsageTable.tsx +++ b/projects/app/src/pages/account/components/UsageTable.tsx @@ -14,21 +14,23 @@ import { import { UsageSourceEnum, UsageSourceMap } from '@fastgpt/global/support/wallet/usage/constants'; import { getUserUsages } from '@/web/support/wallet/usage/api'; import type { UsageItemType } from '@fastgpt/global/support/wallet/usage/type'; -import { usePagination } from '@/web/common/hooks/usePagination'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import dayjs from 'dayjs'; import MyIcon from '@fastgpt/web/components/common/Icon'; -import DateRangePicker, { type DateRangeType } from '@/components/DateRangePicker'; +import DateRangePicker, { + type DateRangeType +} from '@fastgpt/web/components/common/DateRangePicker'; import { addDays } from 'date-fns'; import dynamic from 'next/dynamic'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useTranslation } from 'next-i18next'; -import MySelect from '@/components/Select'; import { useQuery } from '@tanstack/react-query'; import { useUserStore } from '@/web/support/user/useUserStore'; import { getTeamMembers } from '@/web/support/user/team/api'; import Avatar from '@/components/Avatar'; -import { formatNumber } from '../../../../../../packages/global/common/math/tools'; +import MySelect from '@fastgpt/web/components/common/MySelect'; +import { formatNumber } from '@fastgpt/global/common/math/tools'; const UsageDetail = dynamic(() => import('./UsageDetail')); const UsageTable = () => { diff --git a/projects/app/src/pages/account/components/standardDetailModal.tsx b/projects/app/src/pages/account/components/standardDetailModal.tsx index da86ed901a5f..657099fb3a42 100644 --- a/projects/app/src/pages/account/components/standardDetailModal.tsx +++ b/projects/app/src/pages/account/components/standardDetailModal.tsx @@ -14,7 +14,7 @@ import { import MyModal from '@/components/MyModal'; import { useTranslation } from 'next-i18next'; import { useQuery } from '@tanstack/react-query'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import MyIcon from '@fastgpt/web/components/common/Icon'; import { getTeamPlans } from '@/web/support/user/team/api'; import { subTypeMap, standardSubLevelMap } from '@fastgpt/global/support/wallet/sub/constants'; diff --git a/projects/app/src/pages/app/detail/components/Logs.tsx b/projects/app/src/pages/app/detail/components/Logs.tsx index 06e843069669..2af70197ac78 100644 --- a/projects/app/src/pages/app/detail/components/Logs.tsx +++ b/projects/app/src/pages/app/detail/components/Logs.tsx @@ -15,7 +15,6 @@ import { } from '@chakra-ui/react'; import MyIcon from '@fastgpt/web/components/common/Icon'; import { useTranslation } from 'next-i18next'; -import { usePagination } from '@/web/common/hooks/usePagination'; import { getAppChatLogs } from '@/web/core/app/api'; import dayjs from 'dayjs'; import { ChatSourceMap } from '@fastgpt/global/core/chat/constants'; @@ -27,9 +26,10 @@ import { useQuery } from '@tanstack/react-query'; import { getInitChatInfo } from '@/web/core/chat/api'; import Tag from '@/components/Tag'; import MyModal from '@/components/MyModal'; -import DateRangePicker, { type DateRangeType } from '@/components/DateRangePicker'; import { addDays } from 'date-fns'; import MyBox from '@/components/common/MyBox'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; +import DateRangePicker, { DateRangeType } from '@fastgpt/web/components/common/DateRangePicker'; const Logs = ({ appId }: { appId: string }) => { const { t } = useTranslation(); diff --git a/projects/app/src/pages/app/detail/components/OutLink/Share.tsx b/projects/app/src/pages/app/detail/components/OutLink/Share.tsx index eb4631d655b4..a6e6e8e894a1 100644 --- a/projects/app/src/pages/app/detail/components/OutLink/Share.tsx +++ b/projects/app/src/pages/app/detail/components/OutLink/Share.tsx @@ -18,7 +18,7 @@ import { } from '@chakra-ui/react'; import { QuestionOutlineIcon } from '@chakra-ui/icons'; import MyIcon from '@fastgpt/web/components/common/Icon'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import { useQuery } from '@tanstack/react-query'; import { getShareChatList, diff --git a/projects/app/src/pages/app/detail/components/SimpleEdit/EditForm.tsx b/projects/app/src/pages/app/detail/components/SimpleEdit/EditForm.tsx index 08a898829014..7b753bf8d809 100644 --- a/projects/app/src/pages/app/detail/components/SimpleEdit/EditForm.tsx +++ b/projects/app/src/pages/app/detail/components/SimpleEdit/EditForm.tsx @@ -31,10 +31,10 @@ import Avatar from '@/components/Avatar'; import MyIcon from '@fastgpt/web/components/common/Icon'; import VariableEdit from '@/components/core/module/Flow/components/modules/VariableEdit'; import MyTextarea from '@/components/common/Textarea/MyTextarea/index'; -import SelectAiModel from '@/components/Select/SelectAiModel'; import PromptEditor from '@fastgpt/web/components/common/Textarea/PromptEditor'; import { formatEditorVariablePickerIcon } from '@fastgpt/global/core/module/utils'; import SearchParamsTip from '@/components/core/dataset/SearchParamsTip'; +import SelectAiModel from '@/components/Select/SelectAiModel'; const DatasetSelectModal = dynamic(() => import('@/components/core/module/DatasetSelectModal')); const DatasetParamsModal = dynamic(() => import('@/components/core/module/DatasetParamsModal')); diff --git a/projects/app/src/pages/app/detail/index.tsx b/projects/app/src/pages/app/detail/index.tsx index 3ba8fdc3eb88..528106311b56 100644 --- a/projects/app/src/pages/app/detail/index.tsx +++ b/projects/app/src/pages/app/detail/index.tsx @@ -11,7 +11,7 @@ import SideTabs from '@/components/SideTabs'; import Avatar from '@/components/Avatar'; import MyIcon from '@fastgpt/web/components/common/Icon'; import PageContainer from '@/components/PageContainer'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; import SimpleEdit from './components/SimpleEdit'; import { serviceSideProps } from '@/web/common/utils/i18n'; import { useAppStore } from '@/web/core/app/store/useAppStore'; diff --git a/projects/app/src/pages/appStore/index.tsx b/projects/app/src/pages/appStore/index.tsx index c9b4a130d37e..5d69d148f2df 100644 --- a/projects/app/src/pages/appStore/index.tsx +++ b/projects/app/src/pages/appStore/index.tsx @@ -1,11 +1,11 @@ import React, { useState, useRef, useCallback } from 'react'; -import { Box, Flex, Card, Grid, Input } from '@chakra-ui/react'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { Box, Flex, Grid } from '@chakra-ui/react'; import { getShareModelList, triggerModelCollection } from '@/web/core/app/api'; -import { usePagination } from '@/web/common/hooks/usePagination'; import type { ShareAppItem } from '@/types/app'; import ShareModelList from './components/list'; import { serviceSideProps } from '@/web/common/utils/i18n'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; const modelList = () => { const { Loading } = useLoading(); diff --git a/projects/app/src/pages/chat/components/ChatHistorySlider.tsx b/projects/app/src/pages/chat/components/ChatHistorySlider.tsx index ecc9f9efd567..2aab07bd5a5f 100644 --- a/projects/app/src/pages/chat/components/ChatHistorySlider.tsx +++ b/projects/app/src/pages/chat/components/ChatHistorySlider.tsx @@ -20,8 +20,8 @@ import { useTranslation } from 'next-i18next'; import { useConfirm } from '@/web/common/hooks/useConfirm'; import Tabs from '@/components/Tabs'; import { useUserStore } from '@/web/support/user/useUserStore'; +import { AppListItemType } from '@fastgpt/global/core/app/type'; import { useQuery } from '@tanstack/react-query'; -import { useAppStore } from '@/web/core/app/store/useAppStore'; import { TeamMemberRoleEnum } from '@fastgpt/global/support/user/team/constant'; type HistoryItemType = { @@ -41,6 +41,8 @@ const ChatHistorySlider = ({ appName, appAvatar, history, + apps = [], + confirmClearText, activeChatId, onChangeChat, onDelHistory, @@ -54,6 +56,8 @@ const ChatHistorySlider = ({ appAvatar: string; history: HistoryItemType[]; activeChatId: string; + apps?: AppListItemType[]; + confirmClearText: string; onChangeChat: (chatId?: string) => void; onDelHistory: (e: { chatId: string }) => void; onClearHistory: () => void; @@ -65,22 +69,18 @@ const ChatHistorySlider = ({ const router = useRouter(); const { t } = useTranslation(); const { isPc } = useSystemStore(); - const { myApps, loadMyApps } = useAppStore(); const { userInfo } = useUserStore(); const [currentTab, setCurrentTab] = useState<`${TabEnum}`>(TabEnum.history); - const isShare = useMemo(() => !appId || !userInfo, [appId, userInfo]); - + const showApps = apps?.length > 0; // custom title edit const { onOpenModal, EditModal: EditTitleModal } = useEditTitle({ title: t('core.chat.Custom History Title'), placeholder: t('core.chat.Custom History Title Description') }); const { openConfirm, ConfirmModal } = useConfirm({ - content: isShare - ? t('core.chat.Confirm to clear share chat history') - : t('core.chat.Confirm to clear history') + content: confirmClearText }); const concatHistory = useMemo( @@ -92,11 +92,11 @@ const ChatHistorySlider = ({ ); useQuery(['init'], () => { - if (isShare) { + if (!showApps) { setCurrentTab(TabEnum.history); return null; } - return loadMyApps(false); + return; }); const canRouteToDetail = useMemo( @@ -140,7 +140,7 @@ const ChatHistorySlider = ({ {/* menu */} - {!isPc && !isShare && ( + {!isPc && appId && ( - {(isPc || isShare) && ( + {(isPc || !showApps) && ( - {myApps.map((item) => ( - { - router.replace({ - query: { - appId: item._id - } - }); - onClose(); + {Array.isArray(apps) && + apps.map((item) => ( + - - - {item.name} - - - ))} + : { + onClick: () => { + router.replace({ + query: { + appId: item._id + } + }); + onClose(); + } + })} + > + + + {item.name} + + + ))} )} diff --git a/projects/app/src/pages/chat/index.tsx b/projects/app/src/pages/chat/index.tsx index dba934e74c71..2e90e16d7c1e 100644 --- a/projects/app/src/pages/chat/index.tsx +++ b/projects/app/src/pages/chat/index.tsx @@ -15,7 +15,7 @@ import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useQuery } from '@tanstack/react-query'; import { streamFetch } from '@/web/common/api/fetch'; import { useChatStore } from '@/web/core/chat/storeChat'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import { useToast } from '@fastgpt/web/hooks/useToast'; import { customAlphabet } from 'nanoid'; const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 12); @@ -277,6 +277,8 @@ const Chat = ({ appId, chatId }: { appId: string; chatId: string }) => { ); })( ({ id: item.chatId, diff --git a/projects/app/src/pages/chat/team.tsx b/projects/app/src/pages/chat/team.tsx index 138a8a617485..854da073c39c 100644 --- a/projects/app/src/pages/chat/team.tsx +++ b/projects/app/src/pages/chat/team.tsx @@ -85,7 +85,6 @@ const OutLink = ({ onMessage: generatingMessage, abortCtrl: controller }); - console.log(responseData); const newTitle = chatContentReplaceBlock(prompts[0].content).slice(0, 20) || prompts[1]?.value?.slice(0, 20) || @@ -291,9 +290,11 @@ const OutLink = ({ })( ({ id: item.chatId, diff --git a/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx b/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx index 07b0b3c4826d..3d79e4aeec18 100644 --- a/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx +++ b/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx @@ -32,9 +32,8 @@ import MyIcon from '@fastgpt/web/components/common/Icon'; import MyInput from '@/components/MyInput'; import dayjs from 'dayjs'; import { useRequest } from '@/web/common/hooks/useRequest'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import { useRouter } from 'next/router'; -import { usePagination } from '@/web/common/hooks/usePagination'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import MyMenu from '@/components/MyMenu'; import { useEditTitle } from '@/web/common/hooks/useEditTitle'; @@ -64,6 +63,7 @@ import { DatasetSchemaType } from '@fastgpt/global/core/dataset/type'; import { DatasetCollectionSyncResultEnum } from '@fastgpt/global/core/dataset/constants'; import MyBox from '@/components/common/MyBox'; import { ImportDataSourceEnum } from './Import'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; const WebSiteConfigModal = dynamic(() => import('./Import/WebsiteConfig'), {}); const FileSourceSelector = dynamic(() => import('./Import/sourceSelector/FileSourceSelector'), {}); diff --git a/projects/app/src/pages/dataset/detail/components/DataCard.tsx b/projects/app/src/pages/dataset/detail/components/DataCard.tsx index ebcd888fc3a3..3dd7a12e04f0 100644 --- a/projects/app/src/pages/dataset/detail/components/DataCard.tsx +++ b/projects/app/src/pages/dataset/detail/components/DataCard.tsx @@ -15,7 +15,6 @@ import { DrawerContent, useDisclosure } from '@chakra-ui/react'; -import { usePagination } from '@/web/common/hooks/usePagination'; import { getDatasetDataList, delOneDatasetDataById, @@ -31,7 +30,7 @@ import { useTranslation } from 'next-i18next'; import { useRouter } from 'next/router'; import MyIcon from '@fastgpt/web/components/common/Icon'; import MyInput from '@/components/MyInput'; -import { useLoading } from '@/web/common/hooks/useLoading'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; import InputDataModal from '../components/InputDataModal'; import RawSourceBox from '@/components/core/dataset/RawSourceBox'; import type { DatasetDataListItemType } from '@/global/core/dataset/type.d'; @@ -48,6 +47,7 @@ import { formatTime2YMDHM } from '@fastgpt/global/common/string/time'; import { formatFileSize } from '@fastgpt/global/common/file/tools'; import { getFileAndOpen } from '@/web/core/dataset/utils'; import MyTooltip from '@/components/MyTooltip'; +import { usePagination } from '@fastgpt/web/hooks/usePagination'; const DataCard = () => { const BoxRef = useRef(null); diff --git a/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileCustomText.tsx b/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileCustomText.tsx index aa60d8206d60..065922a2d7e7 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileCustomText.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileCustomText.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'next-i18next'; import { useForm } from 'react-hook-form'; import { Box, Button, Flex, Input, Textarea } from '@chakra-ui/react'; import { getNanoid } from '@fastgpt/global/common/string/tools'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; const DataProcess = dynamic(() => import('../commonProgress/DataProcess'), { loading: () => diff --git a/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLink.tsx b/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLink.tsx index 14ff0db803cd..ebb2a198ffe4 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLink.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLink.tsx @@ -11,7 +11,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon'; import { LinkCollectionIcon } from '@fastgpt/global/core/dataset/constants'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import { getDocPath } from '@/web/common/system/doc'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; const DataProcess = dynamic(() => import('../commonProgress/DataProcess'), { loading: () => diff --git a/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLocal.tsx b/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLocal.tsx index 5d7fadda732c..ec55c9d72979 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLocal.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/diffSource/FileLocal.tsx @@ -18,7 +18,7 @@ import { useImportStore } from '../Provider'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import dynamic from 'next/dynamic'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; const DataProcess = dynamic(() => import('../commonProgress/DataProcess'), { loading: () => diff --git a/projects/app/src/pages/dataset/detail/components/Info.tsx b/projects/app/src/pages/dataset/detail/components/Info.tsx index 748c1d1567fa..3182d2423e02 100644 --- a/projects/app/src/pages/dataset/detail/components/Info.tsx +++ b/projects/app/src/pages/dataset/detail/components/Info.tsx @@ -13,10 +13,10 @@ import Avatar from '@/components/Avatar'; import MyTooltip from '@/components/MyTooltip'; import { useTranslation } from 'next-i18next'; import PermissionRadio from '@/components/support/permission/Radio'; -import MySelect from '@/components/Select'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useRequest } from '@/web/common/hooks/useRequest'; import { MongoImageTypeEnum } from '@fastgpt/global/common/file/image/constants'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const Info = ({ datasetId }: { datasetId: string }) => { const { t } = useTranslation(); diff --git a/projects/app/src/pages/dataset/detail/components/Test.tsx b/projects/app/src/pages/dataset/detail/components/Test.tsx index f635b0c9b1ea..223dc27cb228 100644 --- a/projects/app/src/pages/dataset/detail/components/Test.tsx +++ b/projects/app/src/pages/dataset/detail/components/Test.tsx @@ -33,7 +33,7 @@ import { } from '@fastgpt/global/core/dataset/constants'; import dynamic from 'next/dynamic'; import { useForm } from 'react-hook-form'; -import MySelect from '@/components/Select'; +import MySelect from '@fastgpt/web/components/common/MySelect'; import { useSelectFile } from '@/web/common/file/hooks/useSelectFile'; import { fileDownload } from '@/web/common/file/utils'; import { readCsvContent } from '@fastgpt/web/common/file/read/csv'; diff --git a/projects/app/src/pages/dataset/list/component/CreateModal.tsx b/projects/app/src/pages/dataset/list/component/CreateModal.tsx index 460314f2cb26..f391c88a5166 100644 --- a/projects/app/src/pages/dataset/list/component/CreateModal.tsx +++ b/projects/app/src/pages/dataset/list/component/CreateModal.tsx @@ -13,12 +13,12 @@ import MyTooltip from '@/components/MyTooltip'; import MyModal from '@/components/MyModal'; import { postCreateDataset } from '@/web/core/dataset/api'; import type { CreateDatasetParams } from '@/global/core/dataset/api.d'; -import MySelect from '@/components/Select'; import { useTranslation } from 'next-i18next'; import MyRadio from '@/components/common/MyRadio'; import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constants'; import { MongoImageTypeEnum } from '@fastgpt/global/common/file/image/constants'; import { QuestionOutlineIcon } from '@chakra-ui/icons'; +import MySelect from '@fastgpt/web/components/common/MySelect'; const CreateModal = ({ onClose, parentId }: { onClose: () => void; parentId?: string }) => { const { t } = useTranslation(); diff --git a/projects/app/src/pages/index.tsx b/projects/app/src/pages/index.tsx index 89d6ec9703f1..846001547121 100644 --- a/projects/app/src/pages/index.tsx +++ b/projects/app/src/pages/index.tsx @@ -1,6 +1,6 @@ import { serviceSideProps } from '@/web/common/utils/i18n'; import React, { useEffect } from 'react'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; import { useRouter } from 'next/router'; const index = () => { diff --git a/projects/app/src/pages/login/components/LoginForm/WechatForm.tsx b/projects/app/src/pages/login/components/LoginForm/WechatForm.tsx index 235dee8bafea..f1f90d4765a6 100644 --- a/projects/app/src/pages/login/components/LoginForm/WechatForm.tsx +++ b/projects/app/src/pages/login/components/LoginForm/WechatForm.tsx @@ -9,7 +9,7 @@ import { useRouter } from 'next/router'; import { useToast } from '@fastgpt/web/hooks/useToast'; import FormLayout from './components/FormLayout'; import { useTranslation } from 'next-i18next'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; interface Props { loginSuccess: (e: ResLogin) => void; diff --git a/projects/app/src/pages/login/fastlogin.tsx b/projects/app/src/pages/login/fastlogin.tsx index 6e0a6e168370..10dbf5bbc07f 100644 --- a/projects/app/src/pages/login/fastlogin.tsx +++ b/projects/app/src/pages/login/fastlogin.tsx @@ -7,7 +7,7 @@ import { useUserStore } from '@/web/support/user/useUserStore'; import { clearToken, setToken } from '@/web/support/user/auth'; import { postFastLogin } from '@/web/support/user/api'; import { useToast } from '@fastgpt/web/hooks/useToast'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; import { serviceSideProps } from '@/web/common/utils/i18n'; import { useQuery } from '@tanstack/react-query'; import { getErrText } from '@fastgpt/global/common/error/utils'; diff --git a/projects/app/src/pages/login/index.tsx b/projects/app/src/pages/login/index.tsx index 3ef7b83b89be..eba704fc8c4e 100644 --- a/projects/app/src/pages/login/index.tsx +++ b/projects/app/src/pages/login/index.tsx @@ -12,7 +12,7 @@ import { serviceSideProps } from '@/web/common/utils/i18n'; import { clearToken, setToken } from '@/web/support/user/auth'; import CommunityModal from '@/components/CommunityModal'; import Script from 'next/script'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; const RegisterForm = dynamic(() => import('./components/RegisterForm')); const ForgetPasswordForm = dynamic(() => import('./components/ForgetPasswordForm')); diff --git a/projects/app/src/pages/login/provider.tsx b/projects/app/src/pages/login/provider.tsx index edc1f8c96328..2e5cb20d56c9 100644 --- a/projects/app/src/pages/login/provider.tsx +++ b/projects/app/src/pages/login/provider.tsx @@ -7,7 +7,7 @@ import { useUserStore } from '@/web/support/user/useUserStore'; import { clearToken, setToken } from '@/web/support/user/auth'; import { oauthLogin } from '@/web/support/user/api'; import { useToast } from '@fastgpt/web/hooks/useToast'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; import { serviceSideProps } from '@/web/common/utils/i18n'; import { getErrText } from '@fastgpt/global/common/error/utils'; import { useTranslation } from 'next-i18next'; diff --git a/projects/app/src/pages/plugin/edit/index.tsx b/projects/app/src/pages/plugin/edit/index.tsx index 0036a631611e..9cc91294e244 100644 --- a/projects/app/src/pages/plugin/edit/index.tsx +++ b/projects/app/src/pages/plugin/edit/index.tsx @@ -10,7 +10,7 @@ import { serviceSideProps } from '@/web/common/utils/i18n'; import { useQuery } from '@tanstack/react-query'; import { getOnePlugin } from '@/web/core/plugin/api'; import { useToast } from '@fastgpt/web/hooks/useToast'; -import Loading from '@/components/Loading'; +import Loading from '@fastgpt/web/components/common/MyLoading'; import { getErrText } from '@fastgpt/global/common/error/utils'; import { useTranslation } from 'next-i18next'; import { usePluginStore } from '@/web/core/plugin/store/plugin'; diff --git a/projects/app/src/web/core/dataset/components/SelectCollections.tsx b/projects/app/src/web/core/dataset/components/SelectCollections.tsx index 5d65acc2d428..8b83e21bb9d0 100644 --- a/projects/app/src/web/core/dataset/components/SelectCollections.tsx +++ b/projects/app/src/web/core/dataset/components/SelectCollections.tsx @@ -1,26 +1,16 @@ import MyIcon from '@fastgpt/web/components/common/Icon'; import MyModal from '@/components/MyModal'; import ParentPaths from '@/components/common/ParentPaths'; -import { useLoading } from '@/web/common/hooks/useLoading'; import { useRequest } from '@/web/common/hooks/useRequest'; import { getDatasetCollectionPathById, getDatasetCollections } from '@/web/core/dataset/api'; import { useDatasetStore } from '@/web/core/dataset/store/dataset'; -import { - Box, - Flex, - ModalFooter, - Button, - useTheme, - Grid, - Card, - Image, - ModalBody -} from '@chakra-ui/react'; +import { Box, Flex, ModalFooter, Button, useTheme, Grid, Card, ModalBody } from '@chakra-ui/react'; import { DatasetCollectionTypeEnum } from '@fastgpt/global/core/dataset/constants'; import { getCollectionIcon } from '@fastgpt/global/core/dataset/utils'; import { useQuery } from '@tanstack/react-query'; import React, { useMemo, useState } from 'react'; import { useTranslation } from 'next-i18next'; +import { useLoading } from '@fastgpt/web/hooks/useLoading'; const SelectCollections = ({ datasetId,