fix(web): agent knowledge_bases update
This commit is contained in:
@@ -413,6 +413,8 @@ export const en = {
|
|||||||
reset: 'Reset',
|
reset: 'Reset',
|
||||||
refresh: 'Refresh',
|
refresh: 'Refresh',
|
||||||
return: 'Return',
|
return: 'Return',
|
||||||
|
statusEnabled: 'Available',
|
||||||
|
statusDisabled: 'Unavailable'
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
searchPlaceholder: 'search 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',
|
configured_disabled_desc: 'API is configured but not enabled',
|
||||||
error_desc: 'API is configured but connection error',
|
error_desc: 'API is configured but connection error',
|
||||||
|
|
||||||
|
testConnectionSuccess: 'Test Connection Successful',
|
||||||
serviceEndpoint: 'Service Endpoint URL',
|
serviceEndpoint: 'Service Endpoint URL',
|
||||||
serviceEndpointPlaceholder: 'URL of the service endpoint',
|
serviceEndpointPlaceholder: 'URL of the service endpoint',
|
||||||
serviceEndpointExtra: 'Complete access address of the MCP service',
|
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',
|
method: 'Method',
|
||||||
path: 'Path',
|
path: 'Path',
|
||||||
viewDetail: 'View Details',
|
viewDetail: 'View Details',
|
||||||
|
textLink: 'Test Connection',
|
||||||
noResult: 'Processing results will be displayed here'
|
noResult: 'Processing results will be displayed here'
|
||||||
},
|
},
|
||||||
workflow: {
|
workflow: {
|
||||||
|
|||||||
@@ -962,6 +962,8 @@ export const zh = {
|
|||||||
reset: '重置',
|
reset: '重置',
|
||||||
refresh: '刷新',
|
refresh: '刷新',
|
||||||
return: '返回',
|
return: '返回',
|
||||||
|
statusEnabled: '可用',
|
||||||
|
statusDisabled: '不可用'
|
||||||
},
|
},
|
||||||
product: {
|
product: {
|
||||||
applicationManagement: '应用管理',
|
applicationManagement: '应用管理',
|
||||||
|
|||||||
@@ -201,7 +201,11 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
|
|||||||
...item,
|
...item,
|
||||||
...filterItem
|
...filterItem
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
setKnowledgeConfig(prev => ({
|
||||||
|
...prev,
|
||||||
|
knowledge_bases: [...knowledge_bases]
|
||||||
|
}))
|
||||||
setData((prev) => {
|
setData((prev) => {
|
||||||
prev = prev as Config
|
prev = prev as Config
|
||||||
const knowledge_retrieval: KnowledgeConfig = {
|
const knowledge_retrieval: KnowledgeConfig = {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import type { FC } from 'react';
|
import type { FC } from 'react';
|
||||||
import { Select, Button } from 'antd';
|
import { Select } from 'antd';
|
||||||
import { Node } from '@antv/x6';
|
// import { Node } from '@antv/x6';
|
||||||
import type { GraphRef } from '../types'
|
import type { GraphRef } from '../types'
|
||||||
|
import { PlusOutlined, MinusOutlined } from '@ant-design/icons'
|
||||||
|
|
||||||
interface CanvasToolbarProps {
|
interface CanvasToolbarProps {
|
||||||
miniMapRef: React.RefObject<HTMLDivElement>;
|
miniMapRef: React.RefObject<HTMLDivElement>;
|
||||||
@@ -18,15 +19,16 @@ interface CanvasToolbarProps {
|
|||||||
const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
||||||
miniMapRef,
|
miniMapRef,
|
||||||
graphRef,
|
graphRef,
|
||||||
isHandMode,
|
// isHandMode,
|
||||||
setIsHandMode,
|
// setIsHandMode,
|
||||||
zoomLevel,
|
zoomLevel,
|
||||||
canUndo,
|
// canUndo,
|
||||||
canRedo,
|
// canRedo,
|
||||||
onUndo,
|
// onUndo,
|
||||||
onRedo,
|
// onRedo,
|
||||||
}) => {
|
}) => {
|
||||||
// 整理布局函数
|
// 整理布局函数
|
||||||
|
/*
|
||||||
const handleLayout = () => {
|
const handleLayout = () => {
|
||||||
if (!graphRef.current) return;
|
if (!graphRef.current) return;
|
||||||
const nodes = graphRef.current.getNodes();
|
const nodes = graphRef.current.getNodes();
|
||||||
@@ -144,28 +146,14 @@ const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
|||||||
currentY += 300; // 不同树之间的间距
|
currentY += 300; // 不同树之间的间距
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
return (
|
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">
|
<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">
|
||||||
<Button
|
<MinusOutlined className="rb:text-[16px] rb:cursor-pointer" onClick={() => graphRef.current?.zoom(-0.1)} />
|
||||||
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>
|
|
||||||
<Select
|
<Select
|
||||||
value={Math.round(zoomLevel * 100)}
|
value={Math.round(zoomLevel * 100)}
|
||||||
onChange={(value: number | string) => {
|
onChange={(value: number | string) => {
|
||||||
@@ -179,7 +167,7 @@ const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
|||||||
console.log('props', props)
|
console.log('props', props)
|
||||||
return `${props.value}%`
|
return `${props.value}%`
|
||||||
}}
|
}}
|
||||||
className="rb:w-20"
|
className="rb:w-20 rb:h-4!"
|
||||||
options={[
|
options={[
|
||||||
{ label: '25%', value: 25 },
|
{ label: '25%', value: 25 },
|
||||||
{ label: '50%', value: 50 },
|
{ label: '50%', value: 50 },
|
||||||
@@ -190,11 +178,10 @@ const CanvasToolbar: FC<CanvasToolbarProps> = ({
|
|||||||
{ label: '200%', value: 200 },
|
{ label: '200%', value: 200 },
|
||||||
{ label: '自适应', value: 'fit' },
|
{ label: '自适应', value: 'fit' },
|
||||||
]}
|
]}
|
||||||
|
variant='borderless'
|
||||||
|
size="small"
|
||||||
/>
|
/>
|
||||||
<Button onClick={() => graphRef.current?.zoom(-0.1)}>-</Button>
|
<PlusOutlined className="rb:text-[16px] rb:cursor-pointer" onClick={() => graphRef.current?.zoom(0.1)} />
|
||||||
<Button disabled={!canUndo} onClick={onUndo}>撤销</Button>
|
|
||||||
<Button disabled={!canRedo} onClick={onRedo}>重做</Button>
|
|
||||||
<Button onClick={handleLayout}>整理</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ export const useWorkflowGraph = ({
|
|||||||
graphRef.current.use(
|
graphRef.current.use(
|
||||||
new MiniMap({
|
new MiniMap({
|
||||||
container: miniMapRef.current,
|
container: miniMapRef.current,
|
||||||
width: 100,
|
width: 170,
|
||||||
height: 80,
|
height: 80,
|
||||||
padding: 5,
|
padding: 5,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user