feat(web): add usage & cost (user consumption) to the Overview dashboard

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 <noreply@anthropic.com>
This commit is contained in:
2026-06-03 10:40:29 +08:00
co-authored by Claude Opus 4.8
parent 8710de7c20
commit 448571496d
2 changed files with 10 additions and 0 deletions
@@ -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() {
/>
</div>
{/* Usage & cost — reuses the existing user consumption stat cards */}
<div>
<p className='text-muted-foreground mb-2 text-[11px] font-semibold tracking-[0.16em] uppercase'>
{t('Usage & cost')}
</p>
<LogStatCards />
</div>
{/* Tier 2: Stream */}
<div className='grid gap-4 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)]'>
<section className='rounded-2xl border border-[color-mix(in_oklch,var(--primary)_22%,var(--border))] bg-[color-mix(in_oklch,var(--card)_70%,transparent)] p-5 backdrop-blur'>
+1
View File
@@ -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": "需补充代码",