/** * Static dashboard page for token-usage-stats. The page is deliberately * dependency-free: one HTML document fetches the sibling JSON endpoint and * renders cards, a series chart, a bucket breakdown, and a per-model table. * * @module @deepseek-ai/dsh-token-usage-stats-web/dashboard */ /** * HTML document rendered at `/token-usage-stats`. * @returns the complete self-contained dashboard document. */ export function renderUsageDashboard(): string { return ` Token 用量统计

Token 用量统计

消费金额
--
API 请求次数
--
次
Tokens
--
输入 + 输出 + 缓存
输出 Tokens
--
输出

Token 构成

按模型统计

模型 Provider 请求数 输入(未命中) 输入(命中缓存) 输出 Tokens 成本

消耗 TOP 5 对话

会话 最后请求 请求数 输入(未命中) 输入(命中缓存) 输出 Tokens 成本

数据来自当前进程内的 ctx.tokenUsageStats,页面自动每 10 秒刷新一次。成本只有在配置了模型定价时才会显示。

` }