fix: var selector (#5593)

* fix: var selector

* doc

* doc time

* doc time

* doc time

* doc time

* doc time

* doc time

* doc time
This commit is contained in:
Archer
2025-09-04 22:46:19 +08:00
committed by GitHub
parent 85ea117481
commit 0ede427a96
11 changed files with 34 additions and 46 deletions

View File

@@ -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

View File

@@ -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<string, string> {
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 <NotFound />;
}
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 (

View File

@@ -1,6 +1,6 @@
---
title: 'V4.12.0(包含升级脚本)'
description: 'FastGPT V4.12.0 更新说明'
description: 'FastGPT V4.12.0 更新说明, 发布于 2025-8-11。'
---
## 更新指南

View File

@@ -1,6 +1,6 @@
---
title: 'V4.12.1(包含升级脚本)'
description: 'FastGPT V4.12.1 更新说明'
description: 'FastGPT V4.12.1 更新说明, 发布于 2025-8-18。'
---
## 更新指南

View File

@@ -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 无需更新

View File

@@ -16,5 +16,6 @@ description: 'FastGPT V4.12.3 更新说明'
1. 单团队模式下,如果用户离开,则无法重新进入团队。
2. 工作流文件上传默认打开,但输入侧未添加文件输出。
3. 连续用户选择,分支无法正常运行。
4. 工作流,变量更新,数组选择器异常。
## 🔨 工具更新

View File

@@ -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",

View File

@@ -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
});

View File

@@ -147,7 +147,7 @@ const EditForm = ({
},
[appForm.aiSettings.systemPrompt, setAppForm]
);
console.log(appForm.chatConfig.fileSelectConfig);
return (
<>
<Box>

View File

@@ -111,19 +111,20 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
(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))
);
}
};

View File

@@ -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 (
<MultipleRowArraySelect
@@ -282,7 +282,7 @@ const MultipleReferenceSelector = ({
fontSize={'sm'}
_hover={{
'.delete': {
display: 'block'
visibility: 'visible'
}
}}
>
@@ -310,7 +310,7 @@ const MultipleReferenceSelector = ({
</Flex>
<MyIcon
className="delete"
display={'none'}
visibility={'hidden'}
name={'common/closeLight'}
w={'1rem'}
ml={1}
@@ -336,7 +336,9 @@ const MultipleReferenceSelector = ({
}
value={value as any}
list={list}
onSelect={onSelect as any}
onSelect={(e) => {
onSelect(e as any);
}}
popDirection={popDirection}
/>
);