Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions web/src/api/statsErrors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import { acceptLanguageHeader, tr } from "../i18n";
/**
* 失败归因(`GET /api/stats/errors`,operator+)。
*
* 数据源是逐请求明细(`usage_hourly` 没有 `error_type` 维度),故只覆盖明细
* 保留期(45 天);后端默认窗口 24 小时。这里单独成文件而不是塞进 `client.ts`:
* 数据源是逐请求明细:全维度汇总 `usage_hourly_dim` 虽带 `error_type`,但小时桶
* 撑不起本端点秒级窗口的契约(理由见 `src/stats/query.py` 中 `errors()` 的
* docstring),故只覆盖明细保留期(默认 45 天,可热更);后端默认窗口 24 小时。
* 这里单独成文件而不是塞进 `client.ts`:
* 统计页的这批新接口与既有请求函数没有共用逻辑,独立文件让改动面最小。
*/
export interface StatsErrorRow {
Expand Down Expand Up @@ -84,7 +86,7 @@ export function useStatsErrors(
* 失败趋势(`GET /api/stats/error-trend`,viewer+)。
*
* 数据源是小时汇总(`usage_hourly_dim`,**永久保留**),因此能回看远超明细
* 保留期(45 天)的失败趋势;代价是**不含逐行救援判定**(小时桶没有
* 保留期(默认 45 天,可热更)的失败趋势;代价是**不含逐行救援判定**(小时桶没有
* request_id,无法关联成功行),故响应里没有 `rescued`。
*/
export interface StatsErrorTrendBucket {
Expand Down Expand Up @@ -127,7 +129,7 @@ async function fetchStatsErrorTrend(
},
);
if (!response.ok) {
throw new Error(`失败趋势加载失败(HTTP ${response.status})`);
throw new Error(tr("失败趋势加载失败(HTTP {0})", [response.status]));
}
return (await response.json()) as StatsErrorTrendResponse;
}
Expand Down
3 changes: 1 addition & 2 deletions web/src/i18n/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ export const TEXT_EN: Record<string, string> = {
"天失败": "days failed",
"天)·": "days) ·",
"失败归因加载失败(HTTP {0})": "Failed to load failure attribution (HTTP {0})",
"失败趋势加载失败(HTTP {0})": "Failed to load failure trend (HTTP {0})",
"完成": "Done",
"官方状态页": "Official status pages",
"官方状态页粒度比本服务的模型级冷却粗、更新也滞后,这里只做解释,不参与选号 / 熔断;本服务实时冷却见「凭证管理」页。数据仅存内存,服务重启后归零。": "Official status pages are coarser than this service's per-model cooldown and lag behind, so they only explain, they never pick credentials or trip the breaker; see the credentials page for live cooldowns. The data lives in memory only and resets when the service restarts.",
Expand Down Expand Up @@ -1278,8 +1279,6 @@ export const TEXT_EN: Record<string, string> = {
"运行中…": "Running…",
"运行时配置加载失败": "Failed to load runtime settings",
"近": "Last ",
"近 30 天": "Last 30 days",
"近 7 天": "Last 7 days",
"近期事故": "Recent incidents",
"返回": "Back",
"还没有备份": "No backups yet",
Expand Down
Loading