From c9e64489b2b9f4ed3e92c5cfff7c042ad70e6812 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Thu, 15 Jan 2026 18:31:58 +0800 Subject: [PATCH] fix(web): agent knowledge_bases update --- web/src/i18n/en.ts | 4 ++ web/src/i18n/zh.ts | 2 + web/src/views/ApplicationConfig/Agent.tsx | 6 ++- .../Workflow/components/CanvasToolbar.tsx | 49 +++++++------------ .../views/Workflow/hooks/useWorkflowGraph.ts | 2 +- 5 files changed, 30 insertions(+), 33 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 8177cd5c..8ec4bdef 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -413,6 +413,8 @@ export const en = { reset: 'Reset', refresh: 'Refresh', return: 'Return', + statusEnabled: 'Available', + statusDisabled: 'Unavailable' }, model: { searchPlaceholder: 'search model…', @@ -1577,6 +1579,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re configured_disabled_desc: 'API is configured but not enabled', error_desc: 'API is configured but connection error', + testConnectionSuccess: 'Test Connection Successful', serviceEndpoint: 'Service Endpoint URL', serviceEndpointPlaceholder: 'URL of the service endpoint', serviceEndpointExtra: 'Complete access address of the MCP service', @@ -1726,6 +1729,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re method: 'Method', path: 'Path', viewDetail: 'View Details', + textLink: 'Test Connection', noResult: 'Processing results will be displayed here' }, workflow: { diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index 1a33ee65..7f75c972 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -962,6 +962,8 @@ export const zh = { reset: '重置', refresh: '刷新', return: '返回', + statusEnabled: '可用', + statusDisabled: '不可用' }, product: { applicationManagement: '应用管理', diff --git a/web/src/views/ApplicationConfig/Agent.tsx b/web/src/views/ApplicationConfig/Agent.tsx index 81f902cb..8907e0f1 100644 --- a/web/src/views/ApplicationConfig/Agent.tsx +++ b/web/src/views/ApplicationConfig/Agent.tsx @@ -201,7 +201,11 @@ const Agent = forwardRef((_props, ref) => { ...item, ...filterItem } - }) + }) + setKnowledgeConfig(prev => ({ + ...prev, + knowledge_bases: [...knowledge_bases] + })) setData((prev) => { prev = prev as Config const knowledge_retrieval: KnowledgeConfig = { diff --git a/web/src/views/Workflow/components/CanvasToolbar.tsx b/web/src/views/Workflow/components/CanvasToolbar.tsx index f5bf7e9c..8ca272e1 100644 --- a/web/src/views/Workflow/components/CanvasToolbar.tsx +++ b/web/src/views/Workflow/components/CanvasToolbar.tsx @@ -1,7 +1,8 @@ import type { FC } from 'react'; -import { Select, Button } from 'antd'; -import { Node } from '@antv/x6'; +import { Select } from 'antd'; +// import { Node } from '@antv/x6'; import type { GraphRef } from '../types' +import { PlusOutlined, MinusOutlined } from '@ant-design/icons' interface CanvasToolbarProps { miniMapRef: React.RefObject; @@ -18,15 +19,16 @@ interface CanvasToolbarProps { const CanvasToolbar: FC = ({ miniMapRef, graphRef, - isHandMode, - setIsHandMode, + // isHandMode, + // setIsHandMode, zoomLevel, - canUndo, - canRedo, - onUndo, - onRedo, + // canUndo, + // canRedo, + // onUndo, + // onRedo, }) => { // 整理布局函数 + /* const handleLayout = () => { if (!graphRef.current) return; const nodes = graphRef.current.getNodes(); @@ -144,28 +146,14 @@ const CanvasToolbar: FC = ({ currentY += 300; // 不同树之间的间距 }); }; - + */ return ( <> {/* 小地图 */} -
+
{/* 缩放控制按钮 */} -
- - +
+ graphRef.current?.zoom(-0.1)} />