fix(web): 链相位语义色/失败可重试 + 模板填入中文标签/删除可撤销/工具卡文案 + 模板库 PageHeader

This commit is contained in:
Yaojia Wang
2026-06-30 08:56:23 +02:00
parent 6bb3559e25
commit 164e98887e
10 changed files with 235 additions and 74 deletions

View File

@@ -320,3 +320,17 @@ export function resolveLegacyRoute(
export function isLegacyTool(tool: Readonly<ToolDescriptorView>): boolean {
return tool.is_legacy && !!tool.legacy_route;
}
// —— 「关联工具」下拉选项 ——
// 工具描述符 → 下拉选项value=key 用于 tool_key 关联label=中文标题供展示,不暴露英文 key
// 模板库「关联生成器」字段据此从纯文本框升级为 Select。
export interface ToolKeyOption {
key: string;
title: string;
}
export function toolKeyOptions(
tools: readonly ToolDescriptorView[] | undefined,
): ToolKeyOption[] {
return (tools ?? []).map((tool) => ({ key: tool.key, title: tool.title }));
}