fix: Token趋势图数值区分输入/输出颜色

This commit is contained in:
thzxx
2026-04-23 17:19:53 +08:00
parent 4070f85214
commit aa9bfa01f7
2 changed files with 18 additions and 4 deletions
+4 -1
View File
@@ -148,7 +148,10 @@ function renderDashboard(): void {
const tooltip = `${r.round}轮 · 输入 ${formatTokenCount(r.prompt_eval_count)} + 输出 ${formatTokenCount(r.eval_count)} = ${formatTokenCount(total)} tokens · ${formatDuration(r.total_duration)}`;
return `
<div class="td-bar-col" title="${tooltip}">
<div class="td-bar-value">${formatTokenCount(total)}</div>
<div class="td-bar-values">
<span class="td-val-output">${formatTokenCount(r.eval_count)}</span>
<span class="td-val-input">${formatTokenCount(r.prompt_eval_count)}</span>
</div>
<div class="td-bar" style="height:${heightPct}%;">
<div class="td-bar-fill">
<div class="td-bar-input" style="height:${inputPct}%;"></div>
+14 -3
View File
@@ -3595,14 +3595,25 @@ html, body {
cursor: default;
}
.td-bar-value {
.td-bar-values {
display: flex;
flex-direction: column;
align-items: center;
gap: 1px;
margin-bottom: 2px;
font-size: 9px;
font-family: var(--font-mono);
color: var(--text-secondary);
margin-bottom: 2px;
white-space: nowrap;
}
.td-val-output {
color: #E8734A;
}
.td-val-input {
color: #9B7ED8;
}
.td-bar {
width: 100%;
border-radius: 4px 4px 0 0;