优化外部工具编辑器的 API 卡片标题显示:优先显示工具名,无工具名时显示默认编号

main
sp mac bookpro 2605 2026-07-27 17:33:41 +08:00
parent aaf3db611e
commit 5eed97a79c
1 changed files with 2 additions and 1 deletions

View File

@ -304,6 +304,7 @@ export default function ExternalToolEditor({ open, agentId, plugin, onClose, onS
{fields.map((field, index) => {
const isExpanded = expandedApiIndexes.includes(index);
const apiName = apis[index]?.name;
return (
<Card
@ -317,7 +318,7 @@ export default function ExternalToolEditor({ open, agentId, plugin, onClose, onS
style={{ padding: 0, fontWeight: 500 }}
icon={isExpanded ? <DownOutlined /> : <RightOutlined />}
>
{`API ${index + 1}`}
{apiName || `API-${index}`}
</Button>
}
className="agent-editor-tool-card"