fix(web): agent knowledge_bases update
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -962,6 +962,8 @@ export const zh = {
|
||||
reset: '重置',
|
||||
refresh: '刷新',
|
||||
return: '返回',
|
||||
statusEnabled: '可用',
|
||||
statusDisabled: '不可用'
|
||||
},
|
||||
product: {
|
||||
applicationManagement: '应用管理',
|
||||
|
||||
@@ -201,7 +201,11 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
|
||||
...item,
|
||||
...filterItem
|
||||
}
|
||||
})
|
||||
})
|
||||
setKnowledgeConfig(prev => ({
|
||||
...prev,
|
||||
knowledge_bases: [...knowledge_bases]
|
||||
}))
|
||||
setData((prev) => {
|
||||
prev = prev as Config
|
||||
const knowledge_retrieval: KnowledgeConfig = {
|
||||
|
||||
@@ -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<HTMLDivElement>;
|
||||
@@ -18,15 +19,16 @@ interface CanvasToolbarProps {
|
||||
const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
||||
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<CanvasToolbarProps> = ({
|
||||
currentY += 300; // 不同树之间的间距
|
||||
});
|
||||
};
|
||||
|
||||
*/
|
||||
return (
|
||||
<>
|
||||
{/* 小地图 */}
|
||||
<div ref={miniMapRef} className="rb:absolute rb:bottom-17 rb:left-5 rb:z-1000"></div>
|
||||
<div ref={miniMapRef} className="rb:absolute rb:bottom-15 rb:right-8 rb:z-1000 rb:rounded-lg rb:overflow-hidden"></div>
|
||||
{/* 缩放控制按钮 */}
|
||||
<div className="rb:absolute rb:bottom-5 rb:left-5 rb:flex rb:flex-row rb:gap-2 rb:z-1000">
|
||||
<Button
|
||||
type={isHandMode ? 'primary' : 'default'}
|
||||
onClick={() => {
|
||||
const newHandMode = !isHandMode;
|
||||
setIsHandMode(newHandMode);
|
||||
if (newHandMode) {
|
||||
graphRef.current?.enablePanning();
|
||||
} else {
|
||||
graphRef.current?.disablePanning();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{isHandMode ? '✋' : '👆'}
|
||||
</Button>
|
||||
<Button onClick={() => graphRef.current?.zoom(0.1)}>+</Button>
|
||||
<div className="rb:h-8.5 rb:bg-[#FFFFFF] rb:border rb:border-[#DFE4ED] rb:rounded-lg rb:shadow-[0px_2px_6px_0px_rgba(33,35,50,0.15)] rb:px-3 rb:py-2 rb:absolute rb:bottom-5 rb:right-8 rb:flex rb:flex-row rb:gap-4 rb:z-1000">
|
||||
<MinusOutlined className="rb:text-[16px] rb:cursor-pointer" onClick={() => graphRef.current?.zoom(-0.1)} />
|
||||
<Select
|
||||
value={Math.round(zoomLevel * 100)}
|
||||
onChange={(value: number | string) => {
|
||||
@@ -179,7 +167,7 @@ const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
||||
console.log('props', props)
|
||||
return `${props.value}%`
|
||||
}}
|
||||
className="rb:w-20"
|
||||
className="rb:w-20 rb:h-4!"
|
||||
options={[
|
||||
{ label: '25%', value: 25 },
|
||||
{ label: '50%', value: 50 },
|
||||
@@ -190,11 +178,10 @@ const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
||||
{ label: '200%', value: 200 },
|
||||
{ label: '自适应', value: 'fit' },
|
||||
]}
|
||||
variant='borderless'
|
||||
size="small"
|
||||
/>
|
||||
<Button onClick={() => graphRef.current?.zoom(-0.1)}>-</Button>
|
||||
<Button disabled={!canUndo} onClick={onUndo}>撤销</Button>
|
||||
<Button disabled={!canRedo} onClick={onRedo}>重做</Button>
|
||||
<Button onClick={handleLayout}>整理</Button>
|
||||
<PlusOutlined className="rb:text-[16px] rb:cursor-pointer" onClick={() => graphRef.current?.zoom(0.1)} />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -422,7 +422,7 @@ export const useWorkflowGraph = ({
|
||||
graphRef.current.use(
|
||||
new MiniMap({
|
||||
container: miniMapRef.current,
|
||||
width: 100,
|
||||
width: 170,
|
||||
height: 80,
|
||||
padding: 5,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user