summaryrefslogtreecommitdiff
path: root/frontend/src/components
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-18 10:05:56 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-18 10:05:56 +0800
commit47f8f15493f839e45d2176563397f25c40125fc4 (patch)
treef48cb70793283bbf82f951ce3cbb39481b6a71b8 /frontend/src/components
parent6f07c14efe8bc73f20ce9ef7313b93a3b0cb6067 (diff)
downloadstrategy-lab-47f8f15493f839e45d2176563397f25c40125fc4.tar.gz
fix(frontend): AI 用量卡回归真实 /api/ai/usage totals.requests
[变更性质] 文案/注释更正(Leader 验收问题 3),无行为变化。 [问题说明] 复核 server/src/ai.rs list_ai_usage:端点本就返回 totals.requests(ai_usage COUNT);前端 dashboardMetrics 一直消费该字段,此前 doc-todo 文案误称后端缺字段。 [修复方案] 更正 metric 卡 data-todo 与 dashboardMetrics 注释;占位 - 仅在端点未返回 totals 时兜底;本轮生产 usageRequests=0 → 显示"0 次"。 [影响范围] ProjectMetricRow.svelte、dashboardMetrics.ts 注释;vitest 75/75 不变。
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/ProjectMetricRow.svelte2
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/src/components/ProjectMetricRow.svelte b/frontend/src/components/ProjectMetricRow.svelte
index 31001bf..7980622 100644
--- a/frontend/src/components/ProjectMetricRow.svelte
+++ b/frontend/src/components/ProjectMetricRow.svelte
@@ -35,7 +35,7 @@
class="metric-card"
data-testid="metric-card"
role="listitem"
- data-todo={metric.usageLabel === '-' ? 'TODO: /api/ai/usage 无 totals.requests 时保持占位 -, 计数端点就绪后切换' : undefined}
+ data-todo={metric.usageLabel === '-' ? 'TODO: /api/ai/usage 未返回 totals.requests(使用记录为空)时保持占位 -' : undefined}
>
<span class="mlabel">AI 用量</span>
<span class="mvalue">{metric.usageLabel}</span>