From 691e777b2c8e04014232ff73a96708d2bdba333b Mon Sep 17 00:00:00 2001 From: Robbs Luo Date: Thu, 3 Dec 2026 10:11:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs=20COD-63=EF=BC=9A=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E6=9C=9F=E4=B8=8E=20error=5Ftype=20=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E6=B3=A8=E9=87=8A=E5=8F=A3=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/statsErrors.ts | 6 ++++-- web/src/i18n/text.ts | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/api/statsErrors.ts b/web/src/api/statsErrors.ts index a9fbca20..6690b00c 100644 --- a/web/src/api/statsErrors.ts +++ b/web/src/api/statsErrors.ts @@ -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 { diff --git a/web/src/i18n/text.ts b/web/src/i18n/text.ts index 4de1f6dd..c03f999a 100644 --- a/web/src/i18n/text.ts +++ b/web/src/i18n/text.ts @@ -1278,8 +1278,6 @@ export const TEXT_EN: Record = { "运行中…": "Running…", "运行时配置加载失败": "Failed to load runtime settings", "近": "Last ", - "近 30 天": "Last 30 days", - "近 7 天": "Last 7 days", "近期事故": "Recent incidents", "返回": "Back", "还没有备份": "No backups yet", From 22c25dacdb134414fe19de2516fd18e9218ff36d Mon Sep 17 00:00:00 2001 From: Robbs Luo Date: Thu, 3 Dec 2026 10:59:41 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=20COD-63=EF=BC=9A=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E9=94=99=E8=AF=AF=E6=96=87=E6=A1=88=E6=94=B9?= =?UTF-8?q?=E8=B5=B0=20tr=EF=BC=8C=E8=A7=A3=E9=94=81=20frontend=20?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E6=8A=A4=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/statsErrors.ts | 4 ++-- web/src/i18n/text.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/api/statsErrors.ts b/web/src/api/statsErrors.ts index 6690b00c..75ca59a3 100644 --- a/web/src/api/statsErrors.ts +++ b/web/src/api/statsErrors.ts @@ -86,7 +86,7 @@ export function useStatsErrors( * 失败趋势(`GET /api/stats/error-trend`,viewer+)。 * * 数据源是小时汇总(`usage_hourly_dim`,**永久保留**),因此能回看远超明细 - * 保留期(45 天)的失败趋势;代价是**不含逐行救援判定**(小时桶没有 + * 保留期(默认 45 天,可热更)的失败趋势;代价是**不含逐行救援判定**(小时桶没有 * request_id,无法关联成功行),故响应里没有 `rescued`。 */ export interface StatsErrorTrendBucket { @@ -129,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; } diff --git a/web/src/i18n/text.ts b/web/src/i18n/text.ts index c03f999a..19e8c461 100644 --- a/web/src/i18n/text.ts +++ b/web/src/i18n/text.ts @@ -1024,6 +1024,7 @@ export const TEXT_EN: Record = { "天失败": "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.",