diff --git a/document/Dockerfile b/document/Dockerfile index 81a2c2299..7c88d341c 100644 --- a/document/Dockerfile +++ b/document/Dockerfile @@ -37,6 +37,7 @@ WORKDIR /app COPY --from=builder /app/public ./public COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static +COPY --from=builder --chown=nextjs:nodejs /app/data ./data USER nextjs ENV NEXT_TELEMETRY_DISABLED=1 diff --git a/document/app/[lang]/docs/[[...slug]]/page.tsx b/document/app/[lang]/docs/[[...slug]]/page.tsx index 8da1fbc26..fd0bb7791 100644 --- a/document/app/[lang]/docs/[[...slug]]/page.tsx +++ b/document/app/[lang]/docs/[[...slug]]/page.tsx @@ -4,25 +4,9 @@ import { notFound } from 'next/navigation'; import NotFound from '@/components/docs/not-found'; import { createRelativeLink } from 'fumadocs-ui/mdx'; import { getMDXComponents } from '@/mdx-components'; -import fs from 'fs'; -import path from 'path'; -// 读取文档修改时间数据 -function getDocLastModifiedData(): Record { - try { - const dataPath = path.join(process.cwd(), 'data', 'doc-last-modified.json'); - - if (!fs.existsSync(dataPath)) { - return {}; - } - - const data = fs.readFileSync(dataPath, 'utf8'); - return JSON.parse(data); - } catch (error) { - console.error('读取文档修改时间数据失败:', error); - return {}; - } -} +// 在构建时导入静态数据 +import docLastModifiedData from '@/data/doc-last-modified.json'; export default async function Page({ params @@ -32,16 +16,15 @@ export default async function Page({ const { lang, slug } = await params; const page = source.getPage(slug, lang); - // 如果页面不存在,调用 notFound() if (!page || !page.data || !page.file) { return ; } const MDXContent = page.data.body; - // 获取文档的最后修改时间 - const docLastModifiedData = getDocLastModifiedData(); - const filePath = `content/docs/${page.file.path}`; + // 使用构建时导入的静态数据 + const filePath = `document/content/docs/${page.file.path}`; + // @ts-ignore const lastModified = docLastModifiedData[filePath] || page.data.lastModified; return ( diff --git a/document/content/docs/upgrading/4-12/4120.mdx b/document/content/docs/upgrading/4-12/4120.mdx index 3302b0dc4..49ee58de3 100644 --- a/document/content/docs/upgrading/4-12/4120.mdx +++ b/document/content/docs/upgrading/4-12/4120.mdx @@ -1,6 +1,6 @@ --- title: 'V4.12.0(包含升级脚本)' -description: 'FastGPT V4.12.0 更新说明' +description: 'FastGPT V4.12.0 更新说明, 发布于 2025-8-11。' --- ## 更新指南 diff --git a/document/content/docs/upgrading/4-12/4121.mdx b/document/content/docs/upgrading/4-12/4121.mdx index f76f0efb0..0560cf6d8 100644 --- a/document/content/docs/upgrading/4-12/4121.mdx +++ b/document/content/docs/upgrading/4-12/4121.mdx @@ -1,6 +1,6 @@ --- title: 'V4.12.1(包含升级脚本)' -description: 'FastGPT V4.12.1 更新说明' +description: 'FastGPT V4.12.1 更新说明, 发布于 2025-8-18。' --- ## 更新指南 diff --git a/document/content/docs/upgrading/4-12/4122.mdx b/document/content/docs/upgrading/4-12/4122.mdx index 1e8c10e10..b93f4eddf 100644 --- a/document/content/docs/upgrading/4-12/4122.mdx +++ b/document/content/docs/upgrading/4-12/4122.mdx @@ -1,14 +1,14 @@ --- title: 'V4.12.2' -description: 'FastGPT V4.12.2 更新说明' +description: 'FastGPT V4.12.2 更新说明, 发布于 2025-8-26。' --- ## 更新指南 ### 1. 更新镜像: -- 更新 FastGPT 镜像tag: v4.12.2-fix -- 更新 FastGPT 商业版镜像tag: v4.12.2-fix +- 更新 FastGPT 镜像tag: v4.12.2-fix3 +- 更新 FastGPT 商业版镜像tag: v4.12.2-fix3 - 更新 fastgpt-plugin 镜像 tag: v0.1.11 - mcp_server 无需更新 - Sandbox 无需更新 diff --git a/document/content/docs/upgrading/4-12/4123.mdx b/document/content/docs/upgrading/4-12/4123.mdx index 1141fa7bc..fa9ed83af 100644 --- a/document/content/docs/upgrading/4-12/4123.mdx +++ b/document/content/docs/upgrading/4-12/4123.mdx @@ -16,5 +16,6 @@ description: 'FastGPT V4.12.3 更新说明' 1. 单团队模式下,如果用户离开,则无法重新进入团队。 2. 工作流文件上传默认打开,但输入侧未添加文件输出。 3. 连续用户选择,分支无法正常运行。 +4. 工作流,变量更新,数组选择器异常。 ## 🔨 工具更新 diff --git a/document/data/doc-last-modified.json b/document/data/doc-last-modified.json index 4fce1c0ca..4dac3ea2c 100644 --- a/document/data/doc-last-modified.json +++ b/document/data/doc-last-modified.json @@ -104,8 +104,8 @@ "document/content/docs/upgrading/4-11/4111.mdx": "2025-08-07T22:49:09+08:00", "document/content/docs/upgrading/4-12/4120.mdx": "2025-08-12T22:45:19+08:00", "document/content/docs/upgrading/4-12/4121.mdx": "2025-08-15T22:53:06+08:00", - "document/content/docs/upgrading/4-12/4122.mdx": "2025-08-27T00:31:33+08:00", - "document/content/docs/upgrading/4-12/4123.mdx": "2025-09-04T13:48:03+08:00", + "document/content/docs/upgrading/4-12/4122.mdx": "2025-09-04T21:37:57+08:00", + "document/content/docs/upgrading/4-12/4123.mdx": "2025-09-04T21:37:57+08:00", "document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00", diff --git a/projects/app/src/components/Select/AIModelSelector.tsx b/projects/app/src/components/Select/AIModelSelector.tsx index 8e8ec51a7..2ca73aebb 100644 --- a/projects/app/src/components/Select/AIModelSelector.tsx +++ b/projects/app/src/components/Select/AIModelSelector.tsx @@ -177,7 +177,7 @@ const MultipleRowSelector = ({ renderList.find((item) => item.value === (modelData?.provider || 'Other')) ?? renderList[renderList.length - 1]; - provider.children.push({ + provider?.children.push({ label: modelData.name, value: modelData.model }); diff --git a/projects/app/src/pageComponents/app/detail/SimpleApp/EditForm.tsx b/projects/app/src/pageComponents/app/detail/SimpleApp/EditForm.tsx index b2322c872..731913b2b 100644 --- a/projects/app/src/pageComponents/app/detail/SimpleApp/EditForm.tsx +++ b/projects/app/src/pageComponents/app/detail/SimpleApp/EditForm.tsx @@ -147,7 +147,7 @@ const EditForm = ({ }, [appForm.aiSettings.systemPrompt, setAppForm] ); - console.log(appForm.chatConfig.fileSelectConfig); + return ( <> diff --git a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeVariableUpdate.tsx b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeVariableUpdate.tsx index 040bbfd44..1248d6447 100644 --- a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeVariableUpdate.tsx +++ b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeVariableUpdate.tsx @@ -111,19 +111,20 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps) => (item) => item.renderType === updateItem.renderType ); - const onUpdateNewValue = (newValue: any) => { - if (isValidReferenceValueFormat(newValue)) { - onUpdateList( - updateList.map((update, i) => - i === index ? { ...update, value: newValue as ReferenceItemValueType } : update - ) - ); - } else { + const onUpdateNewValue = (newValue?: ReferenceValueType | string) => { + if (typeof newValue === 'string') { onUpdateList( updateList.map((update, i) => i === index ? { ...update, value: ['', newValue] } : update ) ); + } else if ( + Array.isArray(newValue) && + (isValidReferenceValueFormat(newValue) || newValue.every(isValidReferenceValueFormat)) + ) { + onUpdateList( + updateList.map((update, i) => (i === index ? { ...update, value: newValue } : update)) + ); } }; diff --git a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx index e4121b88f..aac71a6d7 100644 --- a/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx +++ b/projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/Reference.tsx @@ -258,6 +258,10 @@ const MultipleReferenceSelector = ({ }); }, [getSelectValue, value]); + const invalidList = useMemo(() => { + return formatList.filter((item) => item.nodeName && item.outputName); + }, [formatList]); + useEffect(() => { // Adapt array type from old version if (Array.isArray(value) && typeof value[0] === 'string') { @@ -266,10 +270,6 @@ const MultipleReferenceSelector = ({ } }, [formatList, onSelect, value]); - const invalidList = useMemo(() => { - return formatList.filter((item) => item.nodeName && item.outputName); - }, [formatList]); - const ArraySelector = useMemo(() => { return ( @@ -310,7 +310,7 @@ const MultipleReferenceSelector = ({ { + onSelect(e as any); + }} popDirection={popDirection} /> );