Skip to content

Commit 0ede427

Browse files
authored
fix: var selector (#5593)
* fix: var selector * doc * doc time * doc time * doc time * doc time * doc time * doc time * doc time
1 parent 85ea117 commit 0ede427

File tree

11 files changed

+33
-45
lines changed

11 files changed

+33
-45
lines changed

document/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ WORKDIR /app
3737
COPY --from=builder /app/public ./public
3838
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
3939
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
40+
COPY --from=builder --chown=nextjs:nodejs /app/data ./data
4041
USER nextjs
4142

4243
ENV NEXT_TELEMETRY_DISABLED=1

document/app/[lang]/docs/[[...slug]]/page.tsx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,9 @@ import { notFound } from 'next/navigation';
44
import NotFound from '@/components/docs/not-found';
55
import { createRelativeLink } from 'fumadocs-ui/mdx';
66
import { getMDXComponents } from '@/mdx-components';
7-
import fs from 'fs';
8-
import path from 'path';
97

10-
// 读取文档修改时间数据
11-
function getDocLastModifiedData(): Record<string, string> {
12-
try {
13-
const dataPath = path.join(process.cwd(), 'data', 'doc-last-modified.json');
14-
15-
if (!fs.existsSync(dataPath)) {
16-
return {};
17-
}
18-
19-
const data = fs.readFileSync(dataPath, 'utf8');
20-
return JSON.parse(data);
21-
} catch (error) {
22-
console.error('读取文档修改时间数据失败:', error);
23-
return {};
24-
}
25-
}
8+
// 在构建时导入静态数据
9+
import docLastModifiedData from '@/data/doc-last-modified.json';
2610

2711
export default async function Page({
2812
params
@@ -32,16 +16,15 @@ export default async function Page({
3216
const { lang, slug } = await params;
3317
const page = source.getPage(slug, lang);
3418

35-
// 如果页面不存在,调用 notFound()
3619
if (!page || !page.data || !page.file) {
3720
return <NotFound />;
3821
}
3922

4023
const MDXContent = page.data.body;
4124

42-
// 获取文档的最后修改时间
43-
const docLastModifiedData = getDocLastModifiedData();
44-
const filePath = `content/docs/${page.file.path}`;
25+
// 使用构建时导入的静态数据
26+
const filePath = `document/content/docs/${page.file.path}`;
27+
// @ts-ignore
4528
const lastModified = docLastModifiedData[filePath] || page.data.lastModified;
4629

4730
return (

document/content/docs/upgrading/4-12/4120.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 'V4.12.0(包含升级脚本)'
3-
description: 'FastGPT V4.12.0 更新说明'
3+
description: 'FastGPT V4.12.0 更新说明, 发布于 2025-8-11。'
44
---
55

66
## 更新指南

document/content/docs/upgrading/4-12/4121.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 'V4.12.1(包含升级脚本)'
3-
description: 'FastGPT V4.12.1 更新说明'
3+
description: 'FastGPT V4.12.1 更新说明, 发布于 2025-8-18。'
44
---
55

66
## 更新指南

document/content/docs/upgrading/4-12/4122.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: 'V4.12.2'
3-
description: 'FastGPT V4.12.2 更新说明'
3+
description: 'FastGPT V4.12.2 更新说明, 发布于 2025-8-26。'
44
---
55

66
## 更新指南
77

88
### 1. 更新镜像:
99

10-
- 更新 FastGPT 镜像tag: v4.12.2-fix
11-
- 更新 FastGPT 商业版镜像tag: v4.12.2-fix
10+
- 更新 FastGPT 镜像tag: v4.12.2-fix3
11+
- 更新 FastGPT 商业版镜像tag: v4.12.2-fix3
1212
- 更新 fastgpt-plugin 镜像 tag: v0.1.11
1313
- mcp_server 无需更新
1414
- Sandbox 无需更新

document/content/docs/upgrading/4-12/4123.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ description: 'FastGPT V4.12.3 更新说明'
1616
1. 单团队模式下,如果用户离开,则无法重新进入团队。
1717
2. 工作流文件上传默认打开,但输入侧未添加文件输出。
1818
3. 连续用户选择,分支无法正常运行。
19+
4. 工作流,变量更新,数组选择器异常。
1920

2021
## 🔨 工具更新

document/data/doc-last-modified.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104
"document/content/docs/upgrading/4-11/4111.mdx": "2025-08-07T22:49:09+08:00",
105105
"document/content/docs/upgrading/4-12/4120.mdx": "2025-08-12T22:45:19+08:00",
106106
"document/content/docs/upgrading/4-12/4121.mdx": "2025-08-15T22:53:06+08:00",
107-
"document/content/docs/upgrading/4-12/4122.mdx": "2025-08-27T00:31:33+08:00",
108-
"document/content/docs/upgrading/4-12/4123.mdx": "2025-09-04T13:48:03+08:00",
107+
"document/content/docs/upgrading/4-12/4122.mdx": "2025-09-04T21:37:57+08:00",
108+
"document/content/docs/upgrading/4-12/4123.mdx": "2025-09-04T21:37:57+08:00",
109109
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
110110
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
111111
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",

projects/app/src/components/Select/AIModelSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ const MultipleRowSelector = ({
177177
renderList.find((item) => item.value === (modelData?.provider || 'Other')) ??
178178
renderList[renderList.length - 1];
179179

180-
provider.children.push({
180+
provider?.children.push({
181181
label: modelData.name,
182182
value: modelData.model
183183
});

projects/app/src/pageComponents/app/detail/SimpleApp/EditForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const EditForm = ({
147147
},
148148
[appForm.aiSettings.systemPrompt, setAppForm]
149149
);
150-
console.log(appForm.chatConfig.fileSelectConfig);
150+
151151
return (
152152
<>
153153
<Box>

projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeVariableUpdate.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,19 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
111111
(item) => item.renderType === updateItem.renderType
112112
);
113113

114-
const onUpdateNewValue = (newValue: any) => {
115-
if (isValidReferenceValueFormat(newValue)) {
114+
const onUpdateNewValue = (newValue?: ReferenceValueType | string) => {
115+
if (typeof newValue === 'string') {
116116
onUpdateList(
117117
updateList.map((update, i) =>
118-
i === index ? { ...update, value: newValue as ReferenceItemValueType } : update
118+
i === index ? { ...update, value: ['', newValue] } : update
119119
)
120120
);
121-
} else {
121+
} else if (
122+
Array.isArray(newValue) &&
123+
(isValidReferenceValueFormat(newValue) || newValue.every(isValidReferenceValueFormat))
124+
) {
122125
onUpdateList(
123-
updateList.map((update, i) =>
124-
i === index ? { ...update, value: ['', newValue] } : update
125-
)
126+
updateList.map((update, i) => (i === index ? { ...update, value: newValue } : update))
126127
);
127128
}
128129
};

0 commit comments

Comments
 (0)