From 32ab51a903c0b3764a16940db1efb176bdfc77f6 Mon Sep 17 00:00:00 2001 From: jidekin <294297426@qq.com> Date: Fri, 23 Oct 2026 15:45:29 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E8=B5=84=E4=BA=A7=E5=8D=A1=E7=89=87?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=90=8D/=E6=97=A5=E6=9C=9F=E5=88=86?= =?UTF-8?q?=E4=B8=A4=E8=A1=8C=20+=20=E5=91=BD=E4=B8=AD=E7=8E=87=E5=8A=A0?= =?UTF-8?q?=E5=8F=A3=E5=BE=84=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Users.vue:模型名一行、日期一行(不再挤一起被省略),图像/视频共用 - 命中率(CallLogs 列表列 + Logs 实时 chip)加 hover 说明: 首次请求/短提示词/前缀变化时命中率为 0 属正常 - 版本 2.9.10 → 2.9.11 --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ app/main.py | 2 +- frontend/src/locales/en.ts | 1 + frontend/src/locales/zh.ts | 1 + frontend/src/views/CallLogs.vue | 2 +- frontend/src/views/Logs.vue | 2 +- frontend/src/views/Users.vue | 8 ++++++-- 7 files changed, 40 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55ab401..e83d6e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # CHANGELOG +## 2026-10-23 · 资产卡片模型名/日期分两行 + 命中率口径说明(2.9.10 → 2.9.11) + +老板:「模型名称和日期换行展示吧,不要挤一起了,然后日志的实时里为什么命中缓存率一直都是 0」。 + +### ① 资产卡片:模型名与日期分两行 +`{{ model }} · {{ 时间 }}` 挤一行、窄卡片里被省略号吃掉。改成两行: +- 第一行:模型名(`code` 字体,超长省略 + hover 看全) +- 第二行:日期/耗时(小一号、淡色) +图像与视频两个页签同时生效。 + +### ② 「实时里命中率一直 0」——机制没问题,是样本问题 +用 admin 自己连发 3 次**相同长提示词**(996 token)实测: + +| 第几次 | 输入 | 缓存命中 | 命中率 | +|---|---|---|---| +| 第 1 次 | 996 | 0 | **0.0%** | +| 第 2 次 | 996 | 896 | **90.0%** | +| 第 3 次 | 996 | 896 | **90.0%** | + +而 38 / 41 token 的短测试请求永远是 0。也就是说: +- **首次请求必然 0**(上游还没有可复用的前缀) +- **短提示词不缓存**(几十 token 不满足上游最小缓存长度) +- **前缀变了就整段失效** + +另外「实时」页签按设计**只看自己的调用**(admin 也只看自己的),所以 admin 看到的多是自己那几条短测试 → 全是 0;要看真实分布请去「调用日志」页签。 + +为避免以后再被误读,命中率(列表列 + 实时展开 chip)都加了 hover 说明: +「首次请求、短提示词、或前缀有变化时,上游不会命中缓存,命中率为 0 属正常」。 + ## 2026-10-23 · 用户管理资产卡片的文字压叠修复(2.9.9 → 2.9.10) 老板截图反馈:用户管理展开账号后,图像/视频资产的「标题 / 模型·时间 / 下载按钮」全都压叠在一起。 diff --git a/app/main.py b/app/main.py index e0ba879..4ac0654 100644 --- a/app/main.py +++ b/app/main.py @@ -355,7 +355,7 @@ _docs_on = config.server.docs_enabled # 安全默认关(report: /docs、/ope # 2026-09-30: 2.6.1 → 2.7.0(按老板要求整个删除「火山方舟 Coding Plan」供应商:配置/模型/代码/文档/前端下拉/环境变量全清)。 # 2026-09-30: 2.7.0 → 2.7.1(界面提示白话化:熔断器→供应商自动保护、引擎→运行环境、slug→标识;删 120 个未引用死键)。 # ★ 版本号纪律:每次改动都要往上加,小改动加小版本号、大改动加大版本号(README 有专章)。 -VERSION = "2.9.10" +VERSION = "2.9.11" app = FastAPI( title="API Gateway", diff --git a/frontend/src/locales/en.ts b/frontend/src/locales/en.ts index 2b86b63..728087a 100644 --- a/frontend/src/locales/en.ts +++ b/frontend/src/locales/en.ts @@ -208,6 +208,7 @@ export default { tokCached: 'cached', tokReasoning: 'reasoning', cacheHit: 'cache hit', + cacheHint: 'Cache misses are normal for the first request, short prompts, or changed prefixes', }, calllogs: { title: 'Call log (persisted)', diff --git a/frontend/src/locales/zh.ts b/frontend/src/locales/zh.ts index 03ada73..cac4917 100644 --- a/frontend/src/locales/zh.ts +++ b/frontend/src/locales/zh.ts @@ -208,6 +208,7 @@ export default { tokCached: '缓存命中', tokReasoning: '推理', cacheHit: '缓存命中率', + cacheHint: '首次请求、短提示词、或前缀有变化时,上游不会命中缓存,命中率为 0 属正常', }, calllogs: { title: '调用日志(持久化)', diff --git a/frontend/src/views/CallLogs.vue b/frontend/src/views/CallLogs.vue index 867fee3..35868cb 100644 --- a/frontend/src/views/CallLogs.vue +++ b/frontend/src/views/CallLogs.vue @@ -65,7 +65,7 @@
{{ im.prompt || '—' }}
-
{{ im.served || im.model || '' }} · {{ fmtClock((im.ts || 0) / 1000) }}
+
{{ im.served || im.model || '—' }}
+
{{ fmtClock((im.ts || 0) / 1000) }}
{{ vk.status || vk.kind }}
{{ vk.prompt || '—' }}
-
{{ vk.model || '' }} · {{ vk.elapsed ? vk.elapsed + 's' : '' }}
+
{{ vk.model || '—' }}
+
{{ vk.elapsed ? vk.elapsed + 's' : '' }}{{ vk.elapsed ? ' · ' : '' }}{{ vk.ts ? fmtClock((vk.ts || 0) / 1000) : '' }}
@@ -422,6 +424,8 @@ onMounted(load) color: var(--muted-2); margin-top: 2px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +/* 2026-10-23:模型名与日期各占一行,不再挤在同一行被省略 */ +.asset-time { color: var(--muted-2); font-size: 11px; margin-top: 1px; white-space: nowrap; } /* 下载按钮放卡片底部整行(与图像/视频页一致),不做缩略图上的浮层:手机端不会挤变形 */ .asset-dl { width: 100%; margin-top: auto; } .asset-cell .asset-dl { margin-top: 8px; }