fix(frontend): 统计表格token列防止换行,缓存token合并为总值显示

This commit is contained in:
fawney19
2026-03-14 16:26:07 +08:00
parent 751a4d9111
commit 9c6036a103
3 changed files with 9 additions and 9 deletions

View File

@@ -16,7 +16,7 @@
请求数
</TableHead>
<TableHead class="h-8 px-2 text-right">
<div class="flex flex-col text-xs gap-0.5">
<div class="flex flex-col text-xs gap-0.5 whitespace-nowrap">
<span>输入/输出</span>
<span class="text-muted-foreground font-normal">缓存</span>
</div>
@@ -52,9 +52,9 @@
{{ item.request_count }}
</TableCell>
<TableCell class="text-right py-2 px-2">
<div class="flex flex-col items-end text-xs gap-0.5">
<div class="flex flex-col items-end text-xs gap-0.5 whitespace-nowrap">
<span>{{ formatTokens(item.total_input_context || 0) }} / {{ formatTokens(item.output_tokens || 0) }}</span>
<span class="text-muted-foreground">{{ formatTokens(item.cache_read_tokens || 0) }} / {{ formatTokens(item.cache_creation_tokens || 0) }}</span>
<span class="text-muted-foreground">{{ formatTokens((item.cache_read_tokens || 0) + (item.cache_creation_tokens || 0)) }}</span>
</div>
</TableCell>
<TableCell class="text-right py-2 px-2">

View File

@@ -16,7 +16,7 @@
请求数
</TableHead>
<TableHead class="h-8 px-2 text-right">
<div class="flex flex-col text-xs gap-0.5">
<div class="flex flex-col text-xs gap-0.5 whitespace-nowrap">
<span>输入/输出</span>
<span class="text-muted-foreground font-normal">缓存</span>
</div>
@@ -52,9 +52,9 @@
{{ model.request_count }}
</TableCell>
<TableCell class="text-right py-2 px-2">
<div class="flex flex-col items-end text-xs gap-0.5">
<div class="flex flex-col items-end text-xs gap-0.5 whitespace-nowrap">
<span>{{ formatTokens(model.total_input_context || 0) }} / {{ formatTokens(model.output_tokens || 0) }}</span>
<span class="text-muted-foreground">{{ formatTokens(model.cache_read_tokens || 0) }} / {{ formatTokens(model.cache_creation_tokens || 0) }}</span>
<span class="text-muted-foreground">{{ formatTokens((model.cache_read_tokens || 0) + (model.cache_creation_tokens || 0)) }}</span>
</div>
</TableCell>
<TableCell class="text-right py-2 px-2">

View File

@@ -16,7 +16,7 @@
请求数
</TableHead>
<TableHead class="h-8 px-2 text-right">
<div class="flex flex-col text-xs gap-0.5">
<div class="flex flex-col text-xs gap-0.5 whitespace-nowrap">
<span>输入/输出</span>
<span class="text-muted-foreground font-normal">缓存</span>
</div>
@@ -55,9 +55,9 @@
{{ provider.requests }}
</TableCell>
<TableCell class="text-right py-2 px-2">
<div class="flex flex-col items-end text-xs gap-0.5">
<div class="flex flex-col items-end text-xs gap-0.5 whitespace-nowrap">
<span>{{ formatTokens(provider.totalInputContext || 0) }} / {{ formatTokens(provider.outputTokens || 0) }}</span>
<span class="text-muted-foreground">{{ formatTokens(provider.cacheReadTokens || 0) }} / {{ formatTokens(provider.cacheCreationTokens || 0) }}</span>
<span class="text-muted-foreground">{{ formatTokens((provider.cacheReadTokens || 0) + (provider.cacheCreationTokens || 0)) }}</span>
</div>
</TableCell>
<TableCell class="text-right py-2 px-2">