From c9b02d0c8325b908269a1557eeb961d7ba01b126 Mon Sep 17 00:00:00 2001 From: zhaoying Date: Tue, 30 Dec 2025 11:05:08 +0800 Subject: [PATCH] fix(web): UI update --- web/src/i18n/en.ts | 3 +- web/src/i18n/zh.ts | 51 +++++++++++++++++-- web/src/views/ToolManagement/Inner.tsx | 8 +-- web/src/views/ToolManagement/Mcp.tsx | 2 +- .../components/McpServiceModal.tsx | 6 +++ .../components/TimeToolModal.tsx | 5 +- 6 files changed, 63 insertions(+), 12 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 8ab3765a..fa9a2a68 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1349,6 +1349,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re innerSearchPlaceholder: 'Search tools...', customSearchPlaceholder: 'Search custom tools...', addService: 'Add MCP Service', + editService: 'Edit MCP Service', addServiceSuccess: 'Service added successfully', server_url: 'Service URL', last_health_check: 'Last Connection', @@ -1528,7 +1529,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re model_voting: 'Model Voting', rag: 'Knowledge Retrieval (RAG)', classification: 'Smart Classification', - parameter_extraction: 'Parameter Extraction', + 'parameter-extractor': 'Parameter Extraction', flowControl: 'Flow Control', condition: 'Conditional Branch', iteration: 'Iteration', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index c02c8a70..08797903 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -1459,6 +1459,7 @@ export const zh = { innerSearchPlaceholder: '搜索工具...', customSearchPlaceholder: '搜索自定义工具...', addService: '添加MCP服务', + editService: '编辑MCP服务', addServiceSuccess: '服务添加成功', server_url: '服务地址', last_health_check: '最后连接', @@ -1640,13 +1641,13 @@ export const zh = { model_voting: '多模型投票', 'knowledge-retrieval': '知识检索 (RAG)', classification: '智能分类', - parameter_extraction: '参数提取', + 'parameter-extractor': '参数提取', flowControl: '流程控制', - condition: '条件分支', + 'if-else': '条件分支', iteration: '迭代 (Iteration)', loop: '循环 (Loop)', parallel: '并行执行', - aggregator: '聚合器', + 'var-aggregator': '变量聚合器', externalInteraction: '外部交互', http_request: 'HTTP请求', tools: '工具 (Tools)', @@ -1693,6 +1694,7 @@ export const zh = { editVariable: '编辑变量', variableType: '变量类型', variableName: '变量名称', + invalidVariableName: '变量名只能以英文字母开头,包含英文字母、数字和下划线', description: '显示名称', default: '默认值', required: '必填', @@ -1708,6 +1710,49 @@ export const zh = { query: '查询变量', knowledge_retrieval: '知识库', recallConfig: '召回测试', + }, + 'parameter-extractor': { + model_id: '模型', + text: '输入变量', + params: '提取参数', + prompt: '指令', + + addParam: '添加提取参数', + editParam: '编辑提取参数', + + name: '名称', + invalidParamName: '提取参数名只能以英文字母开头,包含英文字母、数字和下划线', + type: '类型', + desc: '描述', + required: '必填', + + 'string': 'String', + 'number': 'Number', + 'boolean': 'Boolean', + 'array[string]': 'Array[String]', + 'array[number]': 'Array[Number]', + 'array[boolean]': 'Array[Boolean]', + 'array[object]': 'Array[Object]', + }, + 'var-aggregator': { + group: '聚合分组', + invalidVariableName: '变量名只能以英文字母开头,包含英文字母、数字和下划线', + addGroup: '添加分组', + variable: '变量赋值' + }, + 'if-else': { + "empty": '为空', + "not_empty": '不为空', + "contains": '包含', + "not_contains": '不包含', + "startwith": '开始是', + "endwith": '结束是', + "eq": '==', + "ne": '!=', + "lt": '<', + "le": '<=', + "gt": '>', + "ge": '>=' } }, diff --git a/web/src/views/ToolManagement/Inner.tsx b/web/src/views/ToolManagement/Inner.tsx index 620afefa..d256d6c7 100644 --- a/web/src/views/ToolManagement/Inner.tsx +++ b/web/src/views/ToolManagement/Inner.tsx @@ -86,11 +86,11 @@ const Inner: React.FC<{ getStatusTag: (status: string) => ReactNode }> = ({ getS grid={{ gutter: 16, column: 2 }} dataSource={data} renderItem={(item) => ( - + // {item.name[0]} diff --git a/web/src/views/ToolManagement/Mcp.tsx b/web/src/views/ToolManagement/Mcp.tsx index 30e2614f..8df7dc88 100644 --- a/web/src/views/ToolManagement/Mcp.tsx +++ b/web/src/views/ToolManagement/Mcp.tsx @@ -130,7 +130,7 @@ const Mcp: React.FC<{ getStatusTag: (status: string) => ReactNode }> = ({ getSta className="rb:flex rb:gap-4 rb:justify-start rb:text-[#5B6167] rb:text-[14px] rb:leading-5 rb:mb-3" >
{t(`tool.${key}`)}
- {displayValue} +
{displayValue}
); })} diff --git a/web/src/views/ToolManagement/components/McpServiceModal.tsx b/web/src/views/ToolManagement/components/McpServiceModal.tsx index 546dc7b4..ce74b8f0 100644 --- a/web/src/views/ToolManagement/components/McpServiceModal.tsx +++ b/web/src/views/ToolManagement/components/McpServiceModal.tsx @@ -303,15 +303,20 @@ const McpServiceModal = forwardRef(({ title: t('tool.requestHeaderName'), dataIndex: 'key', key: 'key', + width: 120, }, { title: t('tool.requestHeaderValue'), dataIndex: 'value', key: 'value', + render: (value) => { + return
{value}
+ } }, { title: t('common.operation'), key: 'action', + width: 80, render: (_, record, index: number) => (