From ca12f96f9d2ced6748103438110c5118096fdc28 Mon Sep 17 00:00:00 2001 From: dolphin Date: Fri, 6 Dec 2024 19:53:52 +0800 Subject: [PATCH] fix: build error --- src/frontend/src/controllers/API/workflow.ts | 1 + .../flow/FlowNode/component/KnowledgeSelectItem.tsx | 6 +++--- src/frontend/vite.config.mts | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/controllers/API/workflow.ts b/src/frontend/src/controllers/API/workflow.ts index 1c8841d88..af028ebe7 100644 --- a/src/frontend/src/controllers/API/workflow.ts +++ b/src/frontend/src/controllers/API/workflow.ts @@ -399,6 +399,7 @@ const workflowTemplate = [ "key": "knowledge_id", "label": "检索知识库范围", "type": "knowledge_select_multi", + "placeholder": "请选择知识库", "value": { "tab": "knowledge", "value": [] diff --git a/src/frontend/src/pages/BuildPage/flow/FlowNode/component/KnowledgeSelectItem.tsx b/src/frontend/src/pages/BuildPage/flow/FlowNode/component/KnowledgeSelectItem.tsx index 880219cbb..4cb4744d3 100644 --- a/src/frontend/src/pages/BuildPage/flow/FlowNode/component/KnowledgeSelectItem.tsx +++ b/src/frontend/src/pages/BuildPage/flow/FlowNode/component/KnowledgeSelectItem.tsx @@ -26,8 +26,8 @@ type KnowledgeTypeValues = `${KnowledgeType}`; export default function KnowledgeSelectItem({ data, onChange, onValidate }) { const { flow } = useFlowStore() - const currentTabRef = useRef(data.value.type) - const [tabType, setTabType] = useState(data.value.type) + const currentTabRef = useRef(data.value.tab) + const [tabType, setTabType] = useState(data.value.tab) const [value, setValue] = useState(() => data.value.value.map(el => { return { label: el.label, value: el.key } })) @@ -134,7 +134,7 @@ export default function KnowledgeSelectItem({ data, onChange, onValidate }) { hideSearch={tabType === KnowledgeType.Temp} value={value} options={tabType === KnowledgeType.Knowledge ? options : fileOptions} - placeholder={data.help || ''} + placeholder={data.placeholder || ''} searchPlaceholder={t('build.searchBaseName')} onChange={handleSelect} onLoad={() => reload(1, '')} diff --git a/src/frontend/vite.config.mts b/src/frontend/vite.config.mts index 5cfecd19e..b26a6172d 100644 --- a/src/frontend/vite.config.mts +++ b/src/frontend/vite.config.mts @@ -8,6 +8,7 @@ import svgr from "vite-plugin-svgr"; // Use environment variable to determine the target. // const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860"; + const target = process.env.VITE_PROXY_TARGET || "http://192.168.106.120:3002"; const apiRoutes = ["^/api/", "/health"]; const proxyTargets = apiRoutes.reduce((proxyObj, route) => {