From 433e7ed911e30dfc89e8a792176fde7bd9532c5d Mon Sep 17 00:00:00 2001 From: Archer <545436317@qq.com> Date: Mon, 28 Apr 2025 14:19:42 +0800 Subject: [PATCH] Update doc (#4697) * perf: share link tip * udpate doc --- deploy/docker/docker-compose-milvus.yml | 12 ++++++------ .../docker-compose-oceanbase/docker-compose.yml | 12 ++++++------ deploy/docker/docker-compose-pgvector.yml | 12 ++++++------ deploy/docker/docker-compose-zilliz.yml | 12 ++++++------ .../content/zh-cn/docs/development/upgrading/497.md | 2 +- packages/web/i18n/en/chat.json | 1 + packages/web/i18n/zh-CN/chat.json | 1 + packages/web/i18n/zh-Hant/chat.json | 1 + projects/app/src/pages/chat/share.tsx | 13 ++++++++++++- 9 files changed, 40 insertions(+), 26 deletions(-) diff --git a/deploy/docker/docker-compose-milvus.yml b/deploy/docker/docker-compose-milvus.yml index 0a8fdc1fd..7c61a2d3f 100644 --- a/deploy/docker/docker-compose-milvus.yml +++ b/deploy/docker/docker-compose-milvus.yml @@ -126,15 +126,15 @@ services: # fastgpt sandbox: container_name: sandbox - image: ghcr.io/labring/fastgpt-sandbox:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-sandbox:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7-fix # 阿里云 networks: - fastgpt restart: always fastgpt-mcp-server: container_name: fastgpt-mcp-server - image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7-fix # 阿里云 ports: - 3005:3000 networks: @@ -144,8 +144,8 @@ services: - FASTGPT_ENDPOINT=http://fastgpt:3000 fastgpt: container_name: fastgpt - image: ghcr.io/labring/fastgpt:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7-fix # 阿里云 ports: - 3000:3000 networks: diff --git a/deploy/docker/docker-compose-oceanbase/docker-compose.yml b/deploy/docker/docker-compose-oceanbase/docker-compose.yml index 584ff762a..916cb6544 100644 --- a/deploy/docker/docker-compose-oceanbase/docker-compose.yml +++ b/deploy/docker/docker-compose-oceanbase/docker-compose.yml @@ -103,15 +103,15 @@ services: # fastgpt sandbox: container_name: sandbox - image: ghcr.io/labring/fastgpt-sandbox:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-sandbox:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7-fix # 阿里云 networks: - fastgpt restart: always fastgpt-mcp-server: container_name: fastgpt-mcp-server - image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7-fix # 阿里云 ports: - 3005:3000 networks: @@ -121,8 +121,8 @@ services: - FASTGPT_ENDPOINT=http://fastgpt:3000 fastgpt: container_name: fastgpt - image: ghcr.io/labring/fastgpt:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7-fix # 阿里云 ports: - 3000:3000 networks: diff --git a/deploy/docker/docker-compose-pgvector.yml b/deploy/docker/docker-compose-pgvector.yml index 1715901d1..8ff7bc977 100644 --- a/deploy/docker/docker-compose-pgvector.yml +++ b/deploy/docker/docker-compose-pgvector.yml @@ -85,15 +85,15 @@ services: # fastgpt sandbox: container_name: sandbox - image: ghcr.io/labring/fastgpt-sandbox:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-sandbox:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7-fix # 阿里云 networks: - fastgpt restart: always fastgpt-mcp-server: container_name: fastgpt-mcp-server - image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7-fix # 阿里云 ports: - 3005:3000 networks: @@ -103,8 +103,8 @@ services: - FASTGPT_ENDPOINT=http://fastgpt:3000 fastgpt: container_name: fastgpt - image: ghcr.io/labring/fastgpt:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt:v4.9.7-fix-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7-fix # 阿里云 ports: - 3000:3000 networks: diff --git a/deploy/docker/docker-compose-zilliz.yml b/deploy/docker/docker-compose-zilliz.yml index aed8bac56..38547aab2 100644 --- a/deploy/docker/docker-compose-zilliz.yml +++ b/deploy/docker/docker-compose-zilliz.yml @@ -66,15 +66,15 @@ services: sandbox: container_name: sandbox - image: ghcr.io/labring/fastgpt-sandbox:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-sandbox:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7-fix # 阿里云 networks: - fastgpt restart: always fastgpt-mcp-server: container_name: fastgpt-mcp-server - image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7-fix # 阿里云 ports: - 3005:3000 networks: @@ -84,8 +84,8 @@ services: - FASTGPT_ENDPOINT=http://fastgpt:3000 fastgpt: container_name: fastgpt - image: ghcr.io/labring/fastgpt:v4.9.7 # git - # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7 # 阿里云 + image: ghcr.io/labring/fastgpt:v4.9.7-fix # git + # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7-fix # 阿里云 ports: - 3000:3000 networks: diff --git a/docSite/content/zh-cn/docs/development/upgrading/497.md b/docSite/content/zh-cn/docs/development/upgrading/497.md index fffaa1220..11b465a06 100644 --- a/docSite/content/zh-cn/docs/development/upgrading/497.md +++ b/docSite/content/zh-cn/docs/development/upgrading/497.md @@ -13,7 +13,7 @@ weight: 793 ### 2. 更新镜像 tag -- 更新 FastGPT 镜像 tag: v4.9.7 +- 更新 FastGPT 镜像 tag: v4.9.7-fix - 更新 FastGPT 商业版镜像 tag: v4.9.7 - mcp_server 无需更新 - Sandbox 无需更新 diff --git a/packages/web/i18n/en/chat.json b/packages/web/i18n/en/chat.json index 014983e5c..9ad55cd31 100644 --- a/packages/web/i18n/en/chat.json +++ b/packages/web/i18n/en/chat.json @@ -43,6 +43,7 @@ "input_guide_tip": "You can set up some preset questions. When the user inputs a question, related questions from these presets will be suggested.", "input_placeholder_phone": "Please enter your question", "insert_input_guide,_some_data_already_exists": "Duplicate data detected, automatically filtered, {{len}} items inserted", + "invalid_share_url": "Invalid sharing link", "is_chatting": "Chatting in progress... please wait until it finishes", "items": "Items", "llm_tokens": "LLM tokens", diff --git a/packages/web/i18n/zh-CN/chat.json b/packages/web/i18n/zh-CN/chat.json index abf7357a5..a0e7264a2 100644 --- a/packages/web/i18n/zh-CN/chat.json +++ b/packages/web/i18n/zh-CN/chat.json @@ -43,6 +43,7 @@ "input_guide_tip": "可以配置一些预设的问题。在用户输入问题时,会从这些预设问题中获取相关问题进行提示。", "input_placeholder_phone": "输入问题", "insert_input_guide,_some_data_already_exists": "有重复数据,已自动过滤,共插入 {{len}} 条数据", + "invalid_share_url": "无效的分享链接", "is_chatting": "正在聊天中...请等待结束", "items": "条", "llm_tokens": "LLM tokens", diff --git a/packages/web/i18n/zh-Hant/chat.json b/packages/web/i18n/zh-Hant/chat.json index 8ba9246a6..9d8c8e199 100644 --- a/packages/web/i18n/zh-Hant/chat.json +++ b/packages/web/i18n/zh-Hant/chat.json @@ -41,6 +41,7 @@ "input_guide_tip": "您可以設定一些預設問題。當使用者輸入問題時,系統會從這些預設問題中提供相關問題作為提示。", "input_placeholder_phone": "請輸入問題", "insert_input_guide,_some_data_already_exists": "偵測到重複資料,已自動過濾,共插入 {{len}} 筆資料", + "invalid_share_url": "無效的分享鏈接", "is_chatting": "對話進行中...請稍候", "items": "筆", "llm_tokens": "LLM tokens", diff --git a/projects/app/src/pages/chat/share.tsx b/projects/app/src/pages/chat/share.tsx index d9f66c94a..183377d30 100644 --- a/projects/app/src/pages/chat/share.tsx +++ b/projects/app/src/pages/chat/share.tsx @@ -38,6 +38,7 @@ import { ChatSourceEnum } from '@fastgpt/global/core/chat/constants'; import { useI18nLng } from '@fastgpt/web/hooks/useI18n'; import { AppSchema } from '@fastgpt/global/core/app/type'; import ChatQuoteList from '@/pageComponents/chat/ChatQuoteList'; +import { useToast } from '@fastgpt/web/hooks/useToast'; const CustomPluginRunBox = dynamic(() => import('@/pageComponents/chat/CustomPluginRunBox')); @@ -314,6 +315,8 @@ const OutLink = (props: Props) => { }; const Render = (props: Props) => { + const { t } = useTranslation(); + const { toast } = useToast(); const { shareId, authToken, customUid, appId } = props; const { localUId, setLocalUId, loaded } = useShareChatStore(); const { source, chatId, setSource, setAppId, setOutLinkAuthData } = useChatStore(); @@ -363,6 +366,14 @@ const Render = (props: Props) => { useEffect(() => { setAppId(appId); }, [appId, setAppId]); + useMount(() => { + if (!appId) { + toast({ + status: 'warning', + title: t('chat:invalid_share_url') + }); + } + }); return source === ChatSourceEnum.share ? ( @@ -409,7 +420,7 @@ export async function getServerSideProps(context: any) { return { props: { - appId: String(app?.appId) ?? '', + appId: app?.appId ? String(app?.appId) : '', appName: app?.associatedApp?.name ?? 'AI', appAvatar: app?.associatedApp?.avatar ?? '', appIntro: app?.associatedApp?.intro ?? 'AI',