diff --git a/frontend/web/src/admin/modules/Backthink.tsx b/frontend/web/src/admin/modules/Backthink.tsx index 85c81bc..236acf7 100644 --- a/frontend/web/src/admin/modules/Backthink.tsx +++ b/frontend/web/src/admin/modules/Backthink.tsx @@ -10,6 +10,22 @@ import { adminBackthink } from "../../lib/api"; import { useAsyncData } from "../../lib/useAsyncData"; import { BACKTHINK_SESSION_ID } from "../../store/sessionCache"; +/** 推送路由的中文标签(后端 PushResult.Route 的取值域)。未知取值原样显示, + * 绝不猜一个更好听的词。 */ +const PUSH_ROUTE_LABEL: Record = { + active_client: "活跃客户端", + im_bridge: "IM 桥", + rate_limited: "限频拦截", + none: "无投递目标", +}; + +/** 推送路由的色调:真的送出去了才用 ok,被限频拦住是 warn。 */ +function pushRouteTone(route: string): "ok" | "warn" | "neutral" { + if (route === "active_client" || route === "im_bridge") return "ok"; + if (route === "rate_limited") return "warn"; + return "neutral"; +} + function BackthinkRow({ item }: { item: BackthinkItem }): React.ReactNode { const markPushed = useAppStore((s) => s.markBackthinkPushed); // 裁决 16.4.2:这条思考的链路图取自**后台思考会话**(`sess-backthink`,design/19 §1 @@ -26,6 +42,8 @@ function BackthinkRow({ item }: { item: BackthinkItem }): React.ReactNode { {item.trigger} {item.shouldNotify ? "需要打扰" : "静默"} {item.pushed ? "已推送" : "未推送"} + {item.route ? {PUSH_ROUTE_LABEL[item.route] ?? item.route} : null} + {item.bypassed ? 事件直发 : null}