From 448571496d0af5acb61d3549233d99c10bdb8703 Mon Sep 17 00:00:00 2001 From: chenchen Date: Wed, 3 Jun 2026 10:40:29 +0800 Subject: [PATCH] feat(web): add usage & cost (user consumption) to the Overview dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reuse the existing LogStatCards (requests / quota=cost / tokens=consumption, all props optional) on the Overview cockpit — no new data/logic, just renders the current user usage stats under a "Usage & cost" section. Co-Authored-By: Claude Opus 4.8 --- .../src/features/dashboard/components/cockpit/index.tsx | 9 +++++++++ heicode/web/default/src/i18n/locales/zh.json | 1 + 2 files changed, 10 insertions(+) diff --git a/heicode/web/default/src/features/dashboard/components/cockpit/index.tsx b/heicode/web/default/src/features/dashboard/components/cockpit/index.tsx index fc1ab40..149c287 100644 --- a/heicode/web/default/src/features/dashboard/components/cockpit/index.tsx +++ b/heicode/web/default/src/features/dashboard/components/cockpit/index.tsx @@ -18,6 +18,7 @@ import { listAgentDeployments, type AgentDeployment, } from '@/features/agent-console/api' +import { LogStatCards } from '@/features/dashboard/components/models/log-stat-cards' type StatusKey = 'running' | 'success' | 'failed' | 'pending' @@ -212,6 +213,14 @@ export function CockpitView() { /> + {/* Usage & cost — reuses the existing user consumption stat cards */} +
+

+ {t('Usage & cost')} +

+ +
+ {/* Tier 2: Stream */}
diff --git a/heicode/web/default/src/i18n/locales/zh.json b/heicode/web/default/src/i18n/locales/zh.json index e86c836..13906fd 100644 --- a/heicode/web/default/src/i18n/locales/zh.json +++ b/heicode/web/default/src/i18n/locales/zh.json @@ -232,6 +232,7 @@ "Failed or no deliverable": "失败或无交付物", "Queued / waiting / needs codegen": "排队 / 等待 / 需补代码", "Live overview of your Agent runs.": "你的 Agent 运行实时概览。", + "Usage & cost": "费用与消耗", "Every Agent run on the server, by mode and Manager-judged status. The desktop client shows the runs you started there.": "服务端上的全部 Agent 运行,按模式和 Manager 裁决状态展示。桌面客户端只显示你在客户端发起的运行。", "Completed without deliverable": "完成但无交付物", "Needs codegen": "需补充代码",