mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): unify token breakdown order and flatten tooltip cards
This commit is contained in:
+62
-25
@@ -1291,7 +1291,7 @@ const I18N_MESSAGES_ZH_CN = Object.freeze({
|
|||||||
'cons.cacheRead': '缓存读取',
|
'cons.cacheRead': '缓存读取',
|
||||||
'cons.savedCost': '节省 {cost}',
|
'cons.savedCost': '节省 {cost}',
|
||||||
'cons.outputUsage': '输出用量',
|
'cons.outputUsage': '输出用量',
|
||||||
'cons.replyAndThink': '回复 {resp} · 思考 {think}',
|
'cons.replyAndThink': '思考 {think} · 回复 {resp}',
|
||||||
'cons.trendTitle': '用量趋势',
|
'cons.trendTitle': '用量趋势',
|
||||||
'cons.allTime': '全部时间',
|
'cons.allTime': '全部时间',
|
||||||
'cons.trendHeatmapHint': '按日 ({days}天) · 悬停查看',
|
'cons.trendHeatmapHint': '按日 ({days}天) · 悬停查看',
|
||||||
@@ -1356,7 +1356,7 @@ const I18N_MESSAGES_ZH_CN = Object.freeze({
|
|||||||
'steps.modelCallsOnly': '{calls}次',
|
'steps.modelCallsOnly': '{calls}次',
|
||||||
'steps.modelsSummaryPrefix': '{count} 模型 · ',
|
'steps.modelsSummaryPrefix': '{count} 模型 · ',
|
||||||
'steps.modelPerfFoot': '均速 {tps} · 首字 {ttft} · 缓存 {cache}%',
|
'steps.modelPerfFoot': '均速 {tps} · 首字 {ttft} · 缓存 {cache}%',
|
||||||
'steps.modelSplitFoot': '入 {inTok} · 缓 {cacheTok} · 思 {thinkTok} · 正 {respTok}',
|
'steps.modelSplitFoot': '输入 {inTok} · 缓存 {cacheTok} · 思考 {thinkTok} · 输出 {respTok}',
|
||||||
'steps.fitActiveCardTitle': '{title}(已纳入上方趋势拟合,按住 Ctrl/Shift 点击可多选对比)',
|
'steps.fitActiveCardTitle': '{title}(已纳入上方趋势拟合,按住 Ctrl/Shift 点击可多选对比)',
|
||||||
'steps.fitInactiveCardTitle': '点击在上方拟合图查看 {text}(按住 Ctrl/Shift 点击可多选同图对比)',
|
'steps.fitInactiveCardTitle': '点击在上方拟合图查看 {text}(按住 Ctrl/Shift 点击可多选同图对比)',
|
||||||
'steps.turnMediaOnly': '[图片/附件提问]',
|
'steps.turnMediaOnly': '[图片/附件提问]',
|
||||||
@@ -2000,7 +2000,7 @@ const I18N_MESSAGES_EN_US = Object.freeze({
|
|||||||
'cons.cacheRead': 'Cache Read',
|
'cons.cacheRead': 'Cache Read',
|
||||||
'cons.savedCost': 'Saved {cost}',
|
'cons.savedCost': 'Saved {cost}',
|
||||||
'cons.outputUsage': 'Output',
|
'cons.outputUsage': 'Output',
|
||||||
'cons.replyAndThink': 'Reply {resp} · Think {think}',
|
'cons.replyAndThink': 'Think {think} · Reply {resp}',
|
||||||
'cons.trendTitle': 'Usage Trend',
|
'cons.trendTitle': 'Usage Trend',
|
||||||
'cons.allTime': 'All Time',
|
'cons.allTime': 'All Time',
|
||||||
'cons.trendHeatmapHint': 'Daily ({days}d) · Hover for details',
|
'cons.trendHeatmapHint': 'Daily ({days}d) · Hover for details',
|
||||||
@@ -8442,8 +8442,8 @@ return { ContextSegmentMeter };
|
|||||||
const { createFourSegmentBar } = (() => {
|
const { createFourSegmentBar } = (() => {
|
||||||
/**
|
/**
|
||||||
* @fileoverview 通用 4 段式 Token 构成比例条组件 (FourSegmentBar).
|
* @fileoverview 通用 4 段式 Token 构成比例条组件 (FourSegmentBar).
|
||||||
* 用于在消费概览、热门模型明细及数据来源明细中直观展示:
|
* 用于在消费概览、热门模型明细及模型总览卡片中直观展示:
|
||||||
* 直接输入 (Input)、缓存读取 (Cached)、内容生成 (Output) 与思考推理 (Thinking) 的 Token 占比。
|
* 直接输入 (Input)、缓存读取 (Cached)、思考推理 (Thinking)、内容生成 (Output) 的 Token 占比。
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -8459,18 +8459,18 @@ const { createFourSegmentBar } = (() => {
|
|||||||
* responseTokens?: number,
|
* responseTokens?: number,
|
||||||
* thinkingTokens?: number
|
* thinkingTokens?: number
|
||||||
* }) => void
|
* }) => void
|
||||||
* }} 组件根元素与增量更新方法
|
* }} 组件根元素及增量更新方法
|
||||||
*/
|
*/
|
||||||
function createFourSegmentBar() {
|
function createFourSegmentBar() {
|
||||||
const segInput = h('div', { className: 'progress-seg seg-input' });
|
const segInput = h('div', { className: 'progress-seg seg-input' });
|
||||||
const segCached = h('div', { className: 'progress-seg seg-cached' });
|
const segCached = h('div', { className: 'progress-seg seg-cached' });
|
||||||
const segOutput = h('div', { className: 'progress-seg seg-output' });
|
|
||||||
const segThinking = h('div', { className: 'progress-seg seg-thinking' });
|
const segThinking = h('div', { className: 'progress-seg seg-thinking' });
|
||||||
|
const segOutput = h('div', { className: 'progress-seg seg-output' });
|
||||||
const el = h('div', { className: 'progress-track cons-seg-bar' }, [
|
const el = h('div', { className: 'progress-track cons-seg-bar' }, [
|
||||||
segInput,
|
segInput,
|
||||||
segCached,
|
segCached,
|
||||||
segOutput,
|
|
||||||
segThinking,
|
segThinking,
|
||||||
|
segOutput,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22338,16 +22338,16 @@ const ConsumptionView = defineComponent({
|
|||||||
cacheLbl,
|
cacheLbl,
|
||||||
cacheVal,
|
cacheVal,
|
||||||
]),
|
]),
|
||||||
h('span', { className: 'legend-left' }, [
|
|
||||||
h('span', { className: 'dot-swatch seg-output' }),
|
|
||||||
outLbl,
|
|
||||||
outVal,
|
|
||||||
]),
|
|
||||||
h('span', { className: 'legend-left' }, [
|
h('span', { className: 'legend-left' }, [
|
||||||
h('span', { className: 'dot-swatch seg-thinking' }),
|
h('span', { className: 'dot-swatch seg-thinking' }),
|
||||||
thinkLbl,
|
thinkLbl,
|
||||||
thinkVal,
|
thinkVal,
|
||||||
]),
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-output' }),
|
||||||
|
outLbl,
|
||||||
|
outVal,
|
||||||
|
]),
|
||||||
h('span', { className: 'legend-left' }, [
|
h('span', { className: 'legend-left' }, [
|
||||||
callsLbl,
|
callsLbl,
|
||||||
callsVal,
|
callsVal,
|
||||||
@@ -24208,8 +24208,37 @@ const StepsDetailView = defineComponent({
|
|||||||
const segBar = createFourSegmentBar();
|
const segBar = createFourSegmentBar();
|
||||||
segBar.el.classList.add('smodel-seg-bar');
|
segBar.el.classList.add('smodel-seg-bar');
|
||||||
|
|
||||||
|
const inLbl = h('span', { text: t('cons.footInput') });
|
||||||
|
const cacheLbl = h('span', { text: t('cons.footCache') });
|
||||||
|
const thinkLbl = h('span', { text: t('cons.footThinking') });
|
||||||
|
const outLbl = h('span', { text: t('cons.footOutput') });
|
||||||
|
const inVal = h('strong', { className: 'text-mono' });
|
||||||
|
const cacheVal = h('strong', { className: 'text-mono' });
|
||||||
|
const thinkVal = h('strong', { className: 'text-mono' });
|
||||||
|
const outVal = h('strong', { className: 'text-mono' });
|
||||||
|
const splitEl = h('div', { className: 'smodel-split' }, [
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-input' }),
|
||||||
|
inLbl,
|
||||||
|
inVal,
|
||||||
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-cached' }),
|
||||||
|
cacheLbl,
|
||||||
|
cacheVal,
|
||||||
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-thinking' }),
|
||||||
|
thinkLbl,
|
||||||
|
thinkVal,
|
||||||
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-output' }),
|
||||||
|
outLbl,
|
||||||
|
outVal,
|
||||||
|
]),
|
||||||
|
]);
|
||||||
const perfEl = h('span', { className: 'smodel-perf text-mono' });
|
const perfEl = h('span', { className: 'smodel-perf text-mono' });
|
||||||
const splitEl = h('span', { className: 'smodel-split text-mono' });
|
|
||||||
|
|
||||||
const cardEl = h('div', { className: 'smodel-card' }, [
|
const cardEl = h('div', { className: 'smodel-card' }, [
|
||||||
h('div', { className: 'smodel-head' }, [
|
h('div', { className: 'smodel-head' }, [
|
||||||
@@ -24217,7 +24246,7 @@ const StepsDetailView = defineComponent({
|
|||||||
h('div', { className: 'smodel-totals' }, [tokEl, costEl]),
|
h('div', { className: 'smodel-totals' }, [tokEl, costEl]),
|
||||||
]),
|
]),
|
||||||
segBar.el,
|
segBar.el,
|
||||||
h('div', { className: 'smodel-foot' }, [perfEl, splitEl]),
|
h('div', { className: 'smodel-foot' }, [splitEl, perfEl]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -24231,6 +24260,14 @@ const StepsDetailView = defineComponent({
|
|||||||
segBar,
|
segBar,
|
||||||
perfEl,
|
perfEl,
|
||||||
splitEl,
|
splitEl,
|
||||||
|
inLbl,
|
||||||
|
cacheLbl,
|
||||||
|
thinkLbl,
|
||||||
|
outLbl,
|
||||||
|
inVal,
|
||||||
|
cacheVal,
|
||||||
|
thinkVal,
|
||||||
|
outVal,
|
||||||
cardTitle: '',
|
cardTitle: '',
|
||||||
isHoveringAnomaly: false,
|
isHoveringAnomaly: false,
|
||||||
},
|
},
|
||||||
@@ -24301,7 +24338,7 @@ const StepsDetailView = defineComponent({
|
|||||||
? Math.max(0, Number(m.responseTokens))
|
? Math.max(0, Number(m.responseTokens))
|
||||||
: Math.max(0, outTok - thinkTok);
|
: Math.max(0, outTok - thinkTok);
|
||||||
|
|
||||||
patchText(refs.tokEl, formatTokens(m.totalTokens || 0));
|
patchText(refs.tokEl, formatTokensPrecise(m.totalTokens || 0));
|
||||||
const costNum = Number(m.costUsd || 0);
|
const costNum = Number(m.costUsd || 0);
|
||||||
const isAllUnpriced =
|
const isAllUnpriced =
|
||||||
calls > 0 && Number(m.unpricedCalls || 0) >= calls && !(costNum > 0);
|
calls > 0 && Number(m.unpricedCalls || 0) >= calls && !(costNum > 0);
|
||||||
@@ -24332,6 +24369,15 @@ const StepsDetailView = defineComponent({
|
|||||||
? +((cacheTok / promptTok) * 100).toFixed(1)
|
? +((cacheTok / promptTok) * 100).toFixed(1)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
|
patchText(refs.inLbl, t('cons.footInput'));
|
||||||
|
patchText(refs.cacheLbl, t('cons.footCache'));
|
||||||
|
patchText(refs.thinkLbl, t('cons.footThinking'));
|
||||||
|
patchText(refs.outLbl, t('cons.footOutput'));
|
||||||
|
patchText(refs.inVal, formatTokensPrecise(inTok));
|
||||||
|
patchText(refs.cacheVal, formatTokensPrecise(cacheTok));
|
||||||
|
patchText(refs.thinkVal, formatTokensPrecise(thinkTok));
|
||||||
|
patchText(refs.outVal, formatTokensPrecise(respTok));
|
||||||
|
|
||||||
patchText(
|
patchText(
|
||||||
refs.perfEl,
|
refs.perfEl,
|
||||||
t('steps.modelPerfFoot', {
|
t('steps.modelPerfFoot', {
|
||||||
@@ -24340,15 +24386,6 @@ const StepsDetailView = defineComponent({
|
|||||||
cache: resolvedCachePct,
|
cache: resolvedCachePct,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
patchText(
|
|
||||||
refs.splitEl,
|
|
||||||
t('steps.modelSplitFoot', {
|
|
||||||
inTok: formatTokens(inTok),
|
|
||||||
cacheTok: formatTokens(cacheTok),
|
|
||||||
thinkTok: formatTokens(thinkTok),
|
|
||||||
respTok: formatTokens(respTok),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const isActiveFit =
|
const isActiveFit =
|
||||||
hasMultipleModels && cardGroupKeys.some((k) => fitActiveKeySet.has(k));
|
hasMultipleModels && cardGroupKeys.some((k) => fitActiveKeySet.has(k));
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @fileoverview 通用 4 段式 Token 构成比例条组件 (FourSegmentBar).
|
* @fileoverview 通用 4 段式 Token 构成比例条组件 (FourSegmentBar).
|
||||||
* 用于在消费概览、热门模型明细及数据来源明细中直观展示:
|
* 用于在消费概览、热门模型明细及模型总览卡片中直观展示:
|
||||||
* 直接输入 (Input)、缓存读取 (Cached)、内容生成 (Output) 与思考推理 (Thinking) 的 Token 占比。
|
* 直接输入 (Input)、缓存读取 (Cached)、思考推理 (Thinking)、内容生成 (Output) 的 Token 占比。
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { h, patchStyleVar } from '../../core/domPatch.js';
|
import { h, patchStyleVar } from '../../core/domPatch.js';
|
||||||
@@ -18,18 +18,18 @@ import { h, patchStyleVar } from '../../core/domPatch.js';
|
|||||||
* responseTokens?: number,
|
* responseTokens?: number,
|
||||||
* thinkingTokens?: number
|
* thinkingTokens?: number
|
||||||
* }) => void
|
* }) => void
|
||||||
* }} 组件根元素与增量更新方法
|
* }} 组件根元素及增量更新方法
|
||||||
*/
|
*/
|
||||||
export function createFourSegmentBar() {
|
export function createFourSegmentBar() {
|
||||||
const segInput = h('div', { className: 'progress-seg seg-input' });
|
const segInput = h('div', { className: 'progress-seg seg-input' });
|
||||||
const segCached = h('div', { className: 'progress-seg seg-cached' });
|
const segCached = h('div', { className: 'progress-seg seg-cached' });
|
||||||
const segOutput = h('div', { className: 'progress-seg seg-output' });
|
|
||||||
const segThinking = h('div', { className: 'progress-seg seg-thinking' });
|
const segThinking = h('div', { className: 'progress-seg seg-thinking' });
|
||||||
|
const segOutput = h('div', { className: 'progress-seg seg-output' });
|
||||||
const el = h('div', { className: 'progress-track cons-seg-bar' }, [
|
const el = h('div', { className: 'progress-track cons-seg-bar' }, [
|
||||||
segInput,
|
segInput,
|
||||||
segCached,
|
segCached,
|
||||||
segOutput,
|
|
||||||
segThinking,
|
segThinking,
|
||||||
|
segOutput,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
|
|||||||
'cons.cacheRead': 'Cache Read',
|
'cons.cacheRead': 'Cache Read',
|
||||||
'cons.savedCost': 'Saved {cost}',
|
'cons.savedCost': 'Saved {cost}',
|
||||||
'cons.outputUsage': 'Output',
|
'cons.outputUsage': 'Output',
|
||||||
'cons.replyAndThink': 'Reply {resp} · Think {think}',
|
'cons.replyAndThink': 'Think {think} · Reply {resp}',
|
||||||
'cons.trendTitle': 'Usage Trend',
|
'cons.trendTitle': 'Usage Trend',
|
||||||
'cons.allTime': 'All Time',
|
'cons.allTime': 'All Time',
|
||||||
'cons.trendHeatmapHint': 'Daily ({days}d) · Hover for details',
|
'cons.trendHeatmapHint': 'Daily ({days}d) · Hover for details',
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
|
|||||||
'cons.cacheRead': '缓存读取',
|
'cons.cacheRead': '缓存读取',
|
||||||
'cons.savedCost': '节省 {cost}',
|
'cons.savedCost': '节省 {cost}',
|
||||||
'cons.outputUsage': '输出用量',
|
'cons.outputUsage': '输出用量',
|
||||||
'cons.replyAndThink': '回复 {resp} · 思考 {think}',
|
'cons.replyAndThink': '思考 {think} · 回复 {resp}',
|
||||||
'cons.trendTitle': '用量趋势',
|
'cons.trendTitle': '用量趋势',
|
||||||
'cons.allTime': '全部时间',
|
'cons.allTime': '全部时间',
|
||||||
'cons.trendHeatmapHint': '按日 ({days}天) · 悬停查看',
|
'cons.trendHeatmapHint': '按日 ({days}天) · 悬停查看',
|
||||||
@@ -296,7 +296,7 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
|
|||||||
'steps.modelCallsOnly': '{calls}次',
|
'steps.modelCallsOnly': '{calls}次',
|
||||||
'steps.modelsSummaryPrefix': '{count} 模型 · ',
|
'steps.modelsSummaryPrefix': '{count} 模型 · ',
|
||||||
'steps.modelPerfFoot': '均速 {tps} · 首字 {ttft} · 缓存 {cache}%',
|
'steps.modelPerfFoot': '均速 {tps} · 首字 {ttft} · 缓存 {cache}%',
|
||||||
'steps.modelSplitFoot': '入 {inTok} · 缓 {cacheTok} · 思 {thinkTok} · 正 {respTok}',
|
'steps.modelSplitFoot': '输入 {inTok} · 缓存 {cacheTok} · 思考 {thinkTok} · 输出 {respTok}',
|
||||||
'steps.fitActiveCardTitle': '{title}(已纳入上方趋势拟合,按住 Ctrl/Shift 点击可多选对比)',
|
'steps.fitActiveCardTitle': '{title}(已纳入上方趋势拟合,按住 Ctrl/Shift 点击可多选对比)',
|
||||||
'steps.fitInactiveCardTitle': '点击在上方拟合图查看 {text}(按住 Ctrl/Shift 点击可多选同图对比)',
|
'steps.fitInactiveCardTitle': '点击在上方拟合图查看 {text}(按住 Ctrl/Shift 点击可多选同图对比)',
|
||||||
'steps.turnMediaOnly': '[图片/附件提问]',
|
'steps.turnMediaOnly': '[图片/附件提问]',
|
||||||
|
|||||||
@@ -469,12 +469,9 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-modern-ui="true"] .trend-tip-sub {
|
[data-modern-ui="true"] .trend-tip-sub,
|
||||||
background: var(--modern-surface-subtle);
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-modern-ui="true"] .trend-tip-cost {
|
[data-modern-ui="true"] .trend-tip-cost {
|
||||||
background: var(--modern-surface-subtle);
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-modern-ui="true"] .cons-pop-models {
|
[data-modern-ui="true"] .cons-pop-models {
|
||||||
|
|||||||
@@ -403,13 +403,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trend-tip-cost {
|
.trend-tip-cost {
|
||||||
font-size: var(--fs-sm);
|
font-size: var(--fs-md);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
padding: 2px 7px;
|
padding: 0;
|
||||||
border-radius: var(--radius-xs);
|
border-radius: 0;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
background: color-mix(in srgb, var(--text-primary) 6%, transparent);
|
background: transparent;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
@@ -419,10 +419,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trend-tip-sub {
|
.trend-tip-sub {
|
||||||
padding: 5px 8px;
|
padding: 2px 0;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-xs);
|
border-radius: 0;
|
||||||
background: color-mix(in srgb, var(--text-primary) 4.2%, transparent);
|
background: transparent;
|
||||||
font-size: var(--fs-xs);
|
font-size: var(--fs-xs);
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
@@ -438,8 +438,8 @@
|
|||||||
.trend-tip-sub.is-grid {
|
.trend-tip-sub.is-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
gap: 8px;
|
gap: 10px;
|
||||||
padding: 6px 8px;
|
padding: 2px 0;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
@@ -881,7 +881,7 @@
|
|||||||
|
|
||||||
.trend-tip-sub:not([hidden]) + .cons-pop-models {
|
.trend-tip-sub:not([hidden]) + .cons-pop-models {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
padding-top: 1px;
|
padding-top: 2px;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1093,17 +1093,27 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 2px 10px;
|
gap: 4px 10px;
|
||||||
font-size: var(--fs-sm);
|
font-size: var(--fs-md);
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.smodel-perf {
|
|
||||||
color: var(--text-secondary);
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.smodel-split {
|
.smodel-split {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px 10px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.smodel-split strong {
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.smodel-perf {
|
||||||
|
margin-left: auto;
|
||||||
|
font-size: var(--fs-sm);
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -662,16 +662,16 @@ export const ConsumptionView = defineComponent({
|
|||||||
cacheLbl,
|
cacheLbl,
|
||||||
cacheVal,
|
cacheVal,
|
||||||
]),
|
]),
|
||||||
h('span', { className: 'legend-left' }, [
|
|
||||||
h('span', { className: 'dot-swatch seg-output' }),
|
|
||||||
outLbl,
|
|
||||||
outVal,
|
|
||||||
]),
|
|
||||||
h('span', { className: 'legend-left' }, [
|
h('span', { className: 'legend-left' }, [
|
||||||
h('span', { className: 'dot-swatch seg-thinking' }),
|
h('span', { className: 'dot-swatch seg-thinking' }),
|
||||||
thinkLbl,
|
thinkLbl,
|
||||||
thinkVal,
|
thinkVal,
|
||||||
]),
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-output' }),
|
||||||
|
outLbl,
|
||||||
|
outVal,
|
||||||
|
]),
|
||||||
h('span', { className: 'legend-left' }, [
|
h('span', { className: 'legend-left' }, [
|
||||||
callsLbl,
|
callsLbl,
|
||||||
callsVal,
|
callsVal,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import {
|
|||||||
formatMetric,
|
formatMetric,
|
||||||
formatSpeedMetric,
|
formatSpeedMetric,
|
||||||
formatTokens,
|
formatTokens,
|
||||||
|
formatTokensPrecise,
|
||||||
formatUsd,
|
formatUsd,
|
||||||
mergeModelsByDisplayName,
|
mergeModelsByDisplayName,
|
||||||
normalizeModelDisplayMode,
|
normalizeModelDisplayMode,
|
||||||
@@ -1151,8 +1152,37 @@ export const StepsDetailView = defineComponent({
|
|||||||
const segBar = createFourSegmentBar();
|
const segBar = createFourSegmentBar();
|
||||||
segBar.el.classList.add('smodel-seg-bar');
|
segBar.el.classList.add('smodel-seg-bar');
|
||||||
|
|
||||||
|
const inLbl = h('span', { text: t('cons.footInput') });
|
||||||
|
const cacheLbl = h('span', { text: t('cons.footCache') });
|
||||||
|
const thinkLbl = h('span', { text: t('cons.footThinking') });
|
||||||
|
const outLbl = h('span', { text: t('cons.footOutput') });
|
||||||
|
const inVal = h('strong', { className: 'text-mono' });
|
||||||
|
const cacheVal = h('strong', { className: 'text-mono' });
|
||||||
|
const thinkVal = h('strong', { className: 'text-mono' });
|
||||||
|
const outVal = h('strong', { className: 'text-mono' });
|
||||||
|
const splitEl = h('div', { className: 'smodel-split' }, [
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-input' }),
|
||||||
|
inLbl,
|
||||||
|
inVal,
|
||||||
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-cached' }),
|
||||||
|
cacheLbl,
|
||||||
|
cacheVal,
|
||||||
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-thinking' }),
|
||||||
|
thinkLbl,
|
||||||
|
thinkVal,
|
||||||
|
]),
|
||||||
|
h('span', { className: 'legend-left' }, [
|
||||||
|
h('span', { className: 'dot-swatch seg-output' }),
|
||||||
|
outLbl,
|
||||||
|
outVal,
|
||||||
|
]),
|
||||||
|
]);
|
||||||
const perfEl = h('span', { className: 'smodel-perf text-mono' });
|
const perfEl = h('span', { className: 'smodel-perf text-mono' });
|
||||||
const splitEl = h('span', { className: 'smodel-split text-mono' });
|
|
||||||
|
|
||||||
const cardEl = h('div', { className: 'smodel-card' }, [
|
const cardEl = h('div', { className: 'smodel-card' }, [
|
||||||
h('div', { className: 'smodel-head' }, [
|
h('div', { className: 'smodel-head' }, [
|
||||||
@@ -1160,7 +1190,7 @@ export const StepsDetailView = defineComponent({
|
|||||||
h('div', { className: 'smodel-totals' }, [tokEl, costEl]),
|
h('div', { className: 'smodel-totals' }, [tokEl, costEl]),
|
||||||
]),
|
]),
|
||||||
segBar.el,
|
segBar.el,
|
||||||
h('div', { className: 'smodel-foot' }, [perfEl, splitEl]),
|
h('div', { className: 'smodel-foot' }, [splitEl, perfEl]),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -1174,6 +1204,14 @@ export const StepsDetailView = defineComponent({
|
|||||||
segBar,
|
segBar,
|
||||||
perfEl,
|
perfEl,
|
||||||
splitEl,
|
splitEl,
|
||||||
|
inLbl,
|
||||||
|
cacheLbl,
|
||||||
|
thinkLbl,
|
||||||
|
outLbl,
|
||||||
|
inVal,
|
||||||
|
cacheVal,
|
||||||
|
thinkVal,
|
||||||
|
outVal,
|
||||||
cardTitle: '',
|
cardTitle: '',
|
||||||
isHoveringAnomaly: false,
|
isHoveringAnomaly: false,
|
||||||
},
|
},
|
||||||
@@ -1244,7 +1282,7 @@ export const StepsDetailView = defineComponent({
|
|||||||
? Math.max(0, Number(m.responseTokens))
|
? Math.max(0, Number(m.responseTokens))
|
||||||
: Math.max(0, outTok - thinkTok);
|
: Math.max(0, outTok - thinkTok);
|
||||||
|
|
||||||
patchText(refs.tokEl, formatTokens(m.totalTokens || 0));
|
patchText(refs.tokEl, formatTokensPrecise(m.totalTokens || 0));
|
||||||
const costNum = Number(m.costUsd || 0);
|
const costNum = Number(m.costUsd || 0);
|
||||||
const isAllUnpriced =
|
const isAllUnpriced =
|
||||||
calls > 0 && Number(m.unpricedCalls || 0) >= calls && !(costNum > 0);
|
calls > 0 && Number(m.unpricedCalls || 0) >= calls && !(costNum > 0);
|
||||||
@@ -1275,6 +1313,15 @@ export const StepsDetailView = defineComponent({
|
|||||||
? +((cacheTok / promptTok) * 100).toFixed(1)
|
? +((cacheTok / promptTok) * 100).toFixed(1)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
|
patchText(refs.inLbl, t('cons.footInput'));
|
||||||
|
patchText(refs.cacheLbl, t('cons.footCache'));
|
||||||
|
patchText(refs.thinkLbl, t('cons.footThinking'));
|
||||||
|
patchText(refs.outLbl, t('cons.footOutput'));
|
||||||
|
patchText(refs.inVal, formatTokensPrecise(inTok));
|
||||||
|
patchText(refs.cacheVal, formatTokensPrecise(cacheTok));
|
||||||
|
patchText(refs.thinkVal, formatTokensPrecise(thinkTok));
|
||||||
|
patchText(refs.outVal, formatTokensPrecise(respTok));
|
||||||
|
|
||||||
patchText(
|
patchText(
|
||||||
refs.perfEl,
|
refs.perfEl,
|
||||||
t('steps.modelPerfFoot', {
|
t('steps.modelPerfFoot', {
|
||||||
@@ -1283,15 +1330,6 @@ export const StepsDetailView = defineComponent({
|
|||||||
cache: resolvedCachePct,
|
cache: resolvedCachePct,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
patchText(
|
|
||||||
refs.splitEl,
|
|
||||||
t('steps.modelSplitFoot', {
|
|
||||||
inTok: formatTokens(inTok),
|
|
||||||
cacheTok: formatTokens(cacheTok),
|
|
||||||
thinkTok: formatTokens(thinkTok),
|
|
||||||
respTok: formatTokens(respTok),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const isActiveFit =
|
const isActiveFit =
|
||||||
hasMultipleModels && cardGroupKeys.some((k) => fitActiveKeySet.has(k));
|
hasMultipleModels && cardGroupKeys.some((k) => fitActiveKeySet.has(k));
|
||||||
|
|||||||
+29
-22
@@ -2520,13 +2520,13 @@ html[data-standalone="true"] .app-shell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trend-tip-cost {
|
.trend-tip-cost {
|
||||||
font-size: var(--fs-sm);
|
font-size: var(--fs-md);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
padding: 2px 7px;
|
padding: 0;
|
||||||
border-radius: var(--radius-xs);
|
border-radius: 0;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
background: color-mix(in srgb, var(--text-primary) 6%, transparent);
|
background: transparent;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
@@ -2536,10 +2536,10 @@ html[data-standalone="true"] .app-shell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.trend-tip-sub {
|
.trend-tip-sub {
|
||||||
padding: 5px 8px;
|
padding: 2px 0;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: var(--radius-xs);
|
border-radius: 0;
|
||||||
background: color-mix(in srgb, var(--text-primary) 4.2%, transparent);
|
background: transparent;
|
||||||
font-size: var(--fs-xs);
|
font-size: var(--fs-xs);
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
@@ -2555,8 +2555,8 @@ html[data-standalone="true"] .app-shell {
|
|||||||
.trend-tip-sub.is-grid {
|
.trend-tip-sub.is-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
gap: 8px;
|
gap: 10px;
|
||||||
padding: 6px 8px;
|
padding: 2px 0;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
@@ -2998,7 +2998,7 @@ html[data-standalone="true"] .app-shell {
|
|||||||
|
|
||||||
.trend-tip-sub:not([hidden]) + .cons-pop-models {
|
.trend-tip-sub:not([hidden]) + .cons-pop-models {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
padding-top: 1px;
|
padding-top: 2px;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4239,17 +4239,27 @@ html[data-standalone="true"] .app-shell {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 2px 10px;
|
gap: 4px 10px;
|
||||||
font-size: var(--fs-sm);
|
font-size: var(--fs-md);
|
||||||
color: var(--text-secondary);
|
color: var(--text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.smodel-perf {
|
|
||||||
color: var(--text-secondary);
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.smodel-split {
|
.smodel-split {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 4px 10px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.smodel-split strong {
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.smodel-perf {
|
||||||
|
margin-left: auto;
|
||||||
|
font-size: var(--fs-sm);
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
@@ -6531,12 +6541,9 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-modern-ui="true"] .trend-tip-sub {
|
[data-modern-ui="true"] .trend-tip-sub,
|
||||||
background: var(--modern-surface-subtle);
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-modern-ui="true"] .trend-tip-cost {
|
[data-modern-ui="true"] .trend-tip-cost {
|
||||||
background: var(--modern-surface-subtle);
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-modern-ui="true"] .cons-pop-models {
|
[data-modern-ui="true"] .cons-pop-models {
|
||||||
|
|||||||
@@ -103,6 +103,10 @@ test('FourSegmentBar supports percentage scaling while keeping 100% default for
|
|||||||
thinkingTokens: 100,
|
thinkingTokens: 100,
|
||||||
});
|
});
|
||||||
const segsFull = barFull.el.querySelectorAll('.progress-seg');
|
const segsFull = barFull.el.querySelectorAll('.progress-seg');
|
||||||
|
assert.deepEqual(
|
||||||
|
segsFull.map((el) => el.className.split(/\s+/).find((c) => c.startsWith('seg-'))),
|
||||||
|
['seg-input', 'seg-cached', 'seg-thinking', 'seg-output']
|
||||||
|
);
|
||||||
const sumFull = segsFull.reduce((acc, el) => acc + parsePctVar(el), 0);
|
const sumFull = segsFull.reduce((acc, el) => acc + parsePctVar(el), 0);
|
||||||
assert.ok(Math.abs(sumFull - 100) < 0.05);
|
assert.ok(Math.abs(sumFull - 100) < 0.05);
|
||||||
|
|
||||||
|
|||||||
@@ -279,6 +279,18 @@ test('applyAppearanceToRoot and SettingsGeneralTab toggle data-modern-ui + data-
|
|||||||
builtStyles,
|
builtStyles,
|
||||||
/\[data-modern-ui="true"\]\s+\.trend-tooltip\.is-tracking\s*\{[^}]*150ms/
|
/\[data-modern-ui="true"\]\s+\.trend-tooltip\.is-tracking\s*\{[^}]*150ms/
|
||||||
);
|
);
|
||||||
|
assert.match(
|
||||||
|
builtStyles,
|
||||||
|
/\.trend-tip-sub\s*\{[^}]*background:\s*transparent;/
|
||||||
|
);
|
||||||
|
assert.match(
|
||||||
|
builtStyles,
|
||||||
|
/\.trend-tip-cost\s*\{[^}]*background:\s*transparent;/
|
||||||
|
);
|
||||||
|
assert.match(
|
||||||
|
builtStyles,
|
||||||
|
/\[data-modern-ui="true"\]\s+\.trend-tip-sub,\s*\[data-modern-ui="true"\]\s+\.trend-tip-cost\s*\{[^}]*background:\s*transparent;/
|
||||||
|
);
|
||||||
assert.match(
|
assert.match(
|
||||||
builtStyles,
|
builtStyles,
|
||||||
/\[data-modern-ui="true"\]\.wm-multi-panel\s+\.live-task-card[\s\S]*?background:\s*transparent;/
|
/\[data-modern-ui="true"\]\.wm-multi-panel\s+\.live-task-card[\s\S]*?background:\s*transparent;/
|
||||||
|
|||||||
@@ -2341,7 +2341,7 @@ test('Compiled app.js mounts dual Shadow DOM hosts, tracks /c/<uuid> routes, pro
|
|||||||
assert.equal(smodelCards[0].querySelector('.smodel-name').textContent, 'gemini-4-hydrogen');
|
assert.equal(smodelCards[0].querySelector('.smodel-name').textContent, 'gemini-4-hydrogen');
|
||||||
assert.equal(smodelCards[0].querySelector('.smodel-calls-pill').textContent, '1次 · 50%');
|
assert.equal(smodelCards[0].querySelector('.smodel-calls-pill').textContent, '1次 · 50%');
|
||||||
assert.match(smodelCards[0].querySelector('.smodel-perf').textContent, /均速 92\.3 tok\/s · 首字 5\.6s · 缓存 93\.3%/);
|
assert.match(smodelCards[0].querySelector('.smodel-perf').textContent, /均速 92\.3 tok\/s · 首字 5\.6s · 缓存 93\.3%/);
|
||||||
assert.match(smodelCards[0].querySelector('.smodel-split').textContent, /入 2\.5k · 缓 34\.6k · 思 420 · 正 265/);
|
assert.match(smodelCards[0].querySelector('.smodel-split').textContent, /输入 2\.5k.*缓存 34\.6k.*思考 420.*输出 265/);
|
||||||
|
|
||||||
// Simulate live telemetry poll where a subagent spawns on 'Gemini 3 Flash' (changing activeModelLabel)
|
// Simulate live telemetry poll where a subagent spawns on 'Gemini 3 Flash' (changing activeModelLabel)
|
||||||
// while the user remains inside 总汇总 -> fit model MUST NOT jump!
|
// while the user remains inside 总汇总 -> fit model MUST NOT jump!
|
||||||
|
|||||||
Reference in New Issue
Block a user