优化外部工具编辑器的 API 卡片标题显示:优先显示工具名,无工具名时显示默认编号
parent
aaf3db611e
commit
5eed97a79c
|
|
@ -304,6 +304,7 @@ export default function ExternalToolEditor({ open, agentId, plugin, onClose, onS
|
||||||
|
|
||||||
{fields.map((field, index) => {
|
{fields.map((field, index) => {
|
||||||
const isExpanded = expandedApiIndexes.includes(index);
|
const isExpanded = expandedApiIndexes.includes(index);
|
||||||
|
const apiName = apis[index]?.name;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
|
@ -317,7 +318,7 @@ export default function ExternalToolEditor({ open, agentId, plugin, onClose, onS
|
||||||
style={{ padding: 0, fontWeight: 500 }}
|
style={{ padding: 0, fontWeight: 500 }}
|
||||||
icon={isExpanded ? <DownOutlined /> : <RightOutlined />}
|
icon={isExpanded ? <DownOutlined /> : <RightOutlined />}
|
||||||
>
|
>
|
||||||
{`API ${index + 1}`}
|
{apiName || `API-${index}`}
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
className="agent-editor-tool-card"
|
className="agent-editor-tool-card"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue