fix(ui): 资产卡片模型名/日期分两行 + 命中率加口径说明

- Users.vue:模型名一行、日期一行(不再挤一起被省略),图像/视频共用
- 命中率(CallLogs 列表列 + Logs 实时 chip)加 hover 说明:
  首次请求/短提示词/前缀变化时命中率为 0 属正常
- 版本 2.9.10 → 2.9.11
This commit is contained in:
jidekin committed 2026-10-23 15:45:29 +08:00
1 parent 105ce16e0e
commit 5643824422
7 files changed
+40 -5

No files matched your search

+1
View File
@@ -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)',
+1
View File
@@ -208,6 +208,7 @@ export default {
tokCached: '缓存命中',
tokReasoning: '推理',
cacheHit: '缓存命中率',
cacheHint: '首次请求、短提示词、或前缀有变化时,上游不会命中缓存,命中率为 0 属正常',
},
calllogs: {
title: '调用日志(持久化)',
+1 -1
View File
@@ -65,7 +65,7 @@
<!-- 2026-10-23:缓存命中量与命中率(cached ÷ prompt) -->
<el-table-column :label="t('calllogs.colCache')" width="118">
<template #default="{ row }">
<span v-if="row.tok_prompt" :class="hitCls(row)">
<span v-if="row.tok_prompt" :class="hitCls(row)" :title="t('calllogs.cacheHint')">
{{ fmtTok(row.tok_cached) }}
<i class="hit-pct">{{ hitRate(row) }}%</i>
</span>
+1 -1
View File
@@ -97,7 +97,7 @@
<span class="tok-item">{{ t('logs.tokCompletion') }} <b>{{ row.tokens.completion_tokens ?? 0 }}</b></span>
<span class="tok-item">{{ t('logs.tokCached') }} <b>{{ row.tokens.cached_tokens ?? 0 }}</b></span>
<span class="tok-item">{{ t('logs.tokReasoning') }} <b>{{ row.tokens.reasoning_tokens ?? 0 }}</b></span>
<span class="tok-item tok-hit" :class="hitCls(row)">{{ t('logs.cacheHit') }} <b>{{ hitRate(row) }}%</b></span>
<span class="tok-item tok-hit" :class="hitCls(row)" :title="t('logs.cacheHint')">{{ t('logs.cacheHit') }} <b>{{ hitRate(row) }}%</b></span>
</div>
</div>
<div class="detail-block"><label>{{ t('logs.request') }}</label><pre>{{ row.body || '—' }}</pre></div>
+6 -2
View File
@@ -40,7 +40,8 @@
</template>
</el-image>
<div class="asset-cap ellip3" :title="im.prompt">{{ im.prompt || '—' }}</div>
<div class="asset-meta code ellip">{{ im.served || im.model || '' }} · {{ fmtClock((im.ts || 0) / 1000) }}</div>
<div class="asset-meta code" :title="im.served || im.model || ''">{{ im.served || im.model || '—' }}</div>
<div class="asset-time">{{ fmtClock((im.ts || 0) / 1000) }}</div>
<!-- 管理员代下载他人资产:产物在跨域 CDN 上,直链 <a download> 不生效,
统一走后端 /v1/media/download 代拉,与图像/视频页同一个 lib/download.ts。 -->
<el-button size="small" class="asset-dl"
@@ -61,7 +62,8 @@
<el-tag :type="vk.kind === 'fail' ? 'danger' : vk.kind === 'done' ? 'success' : 'info'" size="small">{{ vk.status || vk.kind }}</el-tag>
</div>
<div class="asset-cap ellip3" :title="vk.prompt">{{ vk.prompt || '—' }}</div>
<div class="asset-meta code ellip">{{ vk.model || '' }} · {{ vk.elapsed ? vk.elapsed + 's' : '' }}</div>
<div class="asset-meta code" :title="vk.model || ''">{{ vk.model || '—' }}</div>
<div class="asset-time">{{ vk.elapsed ? vk.elapsed + 's' : '' }}{{ vk.elapsed ? ' · ' : '' }}{{ vk.ts ? fmtClock((vk.ts || 0) / 1000) : '' }}</div>
<el-button v-if="vk.src" size="small" class="asset-dl"
:loading="dlKey === 'v-' + vk.id"
@click="dlAsset(vk.src, vk.prompt, 'video', 'v-' + vk.id)">
@@ -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; }