mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): add account-isolated per-model quota burn-rate estimator and hover popover
This commit is contained in:
@@ -414,12 +414,331 @@ export function formatAccountTierBadge(account) {
|
||||
return `${tierName} · ${rawPlan}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对账号邮箱或名称做轻量隐私脱敏(如 `sjee80343@gmail.com` -> `sj***43@gmail.com`),
|
||||
* 兼顾多账号辨识度及截图分享隐私安全。
|
||||
*
|
||||
* @param {string|null|undefined} raw
|
||||
* @returns {string}
|
||||
*/
|
||||
export function maskAccountLabel(raw) {
|
||||
const str = String(raw || '').trim();
|
||||
if (!str) return '';
|
||||
const atIdx = str.indexOf('@');
|
||||
if (atIdx > 0 && atIdx < str.length - 1) {
|
||||
const local = str.slice(0, atIdx);
|
||||
const domain = str.slice(atIdx);
|
||||
const chars = Array.from(local);
|
||||
if (chars.length <= 1) return `*${domain}`;
|
||||
if (chars.length === 2) return `${chars[0]}*${domain}`;
|
||||
if (chars.length <= 4) return `${chars[0]}***${chars[chars.length - 1]}${domain}`;
|
||||
return `${chars.slice(0, 2).join('')}***${chars.slice(-2).join('')}${domain}`;
|
||||
}
|
||||
const chars = Array.from(str);
|
||||
if (chars.length <= 1) return '*';
|
||||
if (chars.length === 2) return `${chars[0]}*`;
|
||||
if (chars.length <= 4) return `${chars[0]}***${chars[chars.length - 1]}`;
|
||||
return `${chars.slice(0, 2).join('')}***${chars[chars.length - 1]}`;
|
||||
}
|
||||
|
||||
function formatRateEqUsd(val) {
|
||||
const num = Number(val);
|
||||
if (!Number.isFinite(num) || num <= 0) return '--';
|
||||
if (num >= 10) return `$${Math.round(num)}`;
|
||||
return `$${Number(num.toFixed(1))}`;
|
||||
}
|
||||
|
||||
function formatRatePerUsdValue(rate) {
|
||||
const num = Number(rate);
|
||||
if (!Number.isFinite(num) || num <= 0) return '--';
|
||||
return String(Number(num.toFixed(2)));
|
||||
}
|
||||
|
||||
function formatRateMultiplier(mult) {
|
||||
const num = Number(mult);
|
||||
if (!Number.isFinite(num) || num <= 0) return '';
|
||||
return `${Number(num.toFixed(1))}x`;
|
||||
}
|
||||
|
||||
function createRateModelCard({
|
||||
name,
|
||||
isMutedName = false,
|
||||
isFallback = false,
|
||||
multiplier = null,
|
||||
rate5hPctPerUsd = null,
|
||||
rateWeeklyPctPerUsd = null,
|
||||
eqFull5hUsd = null,
|
||||
eqFullWeeklyUsd = null,
|
||||
samples = 0,
|
||||
}) {
|
||||
const leftNodes = [
|
||||
h('span', {
|
||||
className: `quota-rate-model-name${isMutedName ? ' is-muted' : ''}`,
|
||||
text: name,
|
||||
}),
|
||||
];
|
||||
const multText = formatRateMultiplier(multiplier);
|
||||
if (multText) {
|
||||
leftNodes.push(
|
||||
h('span', {
|
||||
className: `quota-rate-mult-badge${Number(multiplier) >= 1.5 ? ' is-high' : ''}`,
|
||||
text: multText,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const has5hRate = rate5hPctPerUsd != null;
|
||||
const primaryRate = has5hRate ? rate5hPctPerUsd : rateWeeklyPctPerUsd;
|
||||
const subParts = [];
|
||||
if (primaryRate != null) {
|
||||
subParts.push(
|
||||
t('quota.ratePopPerUsd', {
|
||||
win: has5hRate ? '5h' : t('quota.weeklyShort'),
|
||||
rate: formatRatePerUsdValue(primaryRate),
|
||||
})
|
||||
);
|
||||
}
|
||||
if (Number(samples) > 0) {
|
||||
subParts.push(t('quota.ratePopSamples', { n: Number(samples) }));
|
||||
}
|
||||
|
||||
const eqCells = [];
|
||||
if (eqFull5hUsd != null) {
|
||||
eqCells.push(
|
||||
h('div', { className: 'quota-rate-eq-cell' }, [
|
||||
h('span', { className: 'quota-rate-eq-k', text: t('quota.ratePopEq5hLabel') }),
|
||||
h('span', {
|
||||
className: 'quota-rate-eq-v text-mono',
|
||||
text: `≈ ${formatRateEqUsd(eqFull5hUsd)}`,
|
||||
}),
|
||||
])
|
||||
);
|
||||
}
|
||||
if (eqFullWeeklyUsd != null) {
|
||||
eqCells.push(
|
||||
h('div', { className: 'quota-rate-eq-cell' }, [
|
||||
h('span', { className: 'quota-rate-eq-k', text: t('quota.ratePopEqWkLabel') }),
|
||||
h('span', {
|
||||
className: 'quota-rate-eq-v text-mono',
|
||||
text: `≈ ${formatRateEqUsd(eqFullWeeklyUsd)}`,
|
||||
}),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
const cardChildren = [
|
||||
h('div', { className: 'quota-rate-row-top' }, [
|
||||
h('div', { className: 'quota-rate-model-left' }, leftNodes),
|
||||
...(subParts.length > 0
|
||||
? [h('span', { className: 'quota-rate-meta text-mono', text: subParts.join(' · ') })]
|
||||
: []),
|
||||
]),
|
||||
];
|
||||
if (eqCells.length > 0) {
|
||||
cardChildren.push(
|
||||
h(
|
||||
'div',
|
||||
{ className: `quota-rate-eq-grid${eqCells.length === 1 ? ' is-single' : ''}` },
|
||||
eqCells
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return h('div', { className: `quota-rate-model-row${isFallback ? ' is-fallback' : ''}` }, cardChildren);
|
||||
}
|
||||
|
||||
function buildRatePopoverSig(data) {
|
||||
const locale = getEffectiveLocale();
|
||||
const acct = String(data?.account?.email || data?.account?.name || '').trim();
|
||||
const pools = Array.isArray(data?.quotas?.pools) ? data.quotas.pools : [];
|
||||
const poolSig = pools
|
||||
.map((p) => `${p.poolKey || ''}:${p.poolLabel || ''}:${JSON.stringify(p.rateEstimate || null)}`)
|
||||
.join('|');
|
||||
return `${locale}|${acct}|${poolSig}`;
|
||||
}
|
||||
|
||||
export const QuotaPoolsWidget = defineComponent({
|
||||
name: 'QuotaPoolsWidget',
|
||||
setup({ props }) {
|
||||
setup({ props, onCleanup }) {
|
||||
const compactHover = Boolean(props.compactHover);
|
||||
const titleTextEl = h('span', { text: t('module.quotas') });
|
||||
const tierBadge = h('span', { className: 'panel-meta', text: 'Google AI · Pro' });
|
||||
|
||||
const ratePopTitleEl = h('span', {
|
||||
className: 'quota-rate-pop-title',
|
||||
text: t('quota.ratePopTitle'),
|
||||
});
|
||||
const ratePopAccountEl = h('span', {
|
||||
className: 'quota-rate-pop-account',
|
||||
text: t('quota.ratePopAccountCurrent'),
|
||||
});
|
||||
const ratePopBodyEl = h('div', { className: 'quota-rate-pop-body' });
|
||||
const ratePopNoteEl = h('div', {
|
||||
className: 'quota-rate-pop-note',
|
||||
text: t('quota.ratePopNote'),
|
||||
});
|
||||
const ratePopoverEl = h(
|
||||
'div',
|
||||
{
|
||||
className: 'quota-rate-popover',
|
||||
role: 'tooltip',
|
||||
hidden: true,
|
||||
},
|
||||
[
|
||||
h('div', { className: 'quota-rate-pop-head' }, [ratePopTitleEl, ratePopAccountEl]),
|
||||
ratePopBodyEl,
|
||||
ratePopNoteEl,
|
||||
]
|
||||
);
|
||||
ratePopoverEl.hidden = true;
|
||||
|
||||
let ratePopOpen = false;
|
||||
let ratePopCloseTimer = null;
|
||||
let lastRatePopSig = '';
|
||||
|
||||
const cancelRatePopClose = () => {
|
||||
if (ratePopCloseTimer) {
|
||||
clearTimeout(ratePopCloseTimer);
|
||||
ratePopCloseTimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
const setRatePopOpen = (open) => {
|
||||
const next = Boolean(open);
|
||||
ratePopOpen = next;
|
||||
ratePopoverEl.hidden = !next;
|
||||
patchAttr(ratePopoverEl, 'hidden', !next);
|
||||
patchAttr(rateHelpBtn, 'aria-expanded', next ? 'true' : 'false');
|
||||
patchClasses(rateHelpBtn, { 'is-open': next });
|
||||
};
|
||||
|
||||
const openRatePop = () => {
|
||||
cancelRatePopClose();
|
||||
if (!ratePopOpen) setRatePopOpen(true);
|
||||
};
|
||||
|
||||
const scheduleRatePopClose = () => {
|
||||
cancelRatePopClose();
|
||||
ratePopCloseTimer = setTimeout(() => {
|
||||
ratePopCloseTimer = null;
|
||||
setRatePopOpen(false);
|
||||
}, 130);
|
||||
};
|
||||
|
||||
const rateHelpBtn = h(
|
||||
'button',
|
||||
{
|
||||
type: 'button',
|
||||
className: 'quota-rate-help-btn',
|
||||
'aria-label': t('quota.rateHelpAria'),
|
||||
'aria-haspopup': 'true',
|
||||
'aria-expanded': 'false',
|
||||
onMouseenter: openRatePop,
|
||||
onMouseleave: scheduleRatePopClose,
|
||||
onFocus: openRatePop,
|
||||
onBlur: scheduleRatePopClose,
|
||||
onClick: (ev) => {
|
||||
ev?.stopPropagation?.();
|
||||
cancelRatePopClose();
|
||||
setRatePopOpen(!ratePopOpen);
|
||||
},
|
||||
onKeydown: (ev) => {
|
||||
if (ev?.key === 'Escape' && ratePopOpen) {
|
||||
ev.stopPropagation?.();
|
||||
cancelRatePopClose();
|
||||
setRatePopOpen(false);
|
||||
}
|
||||
},
|
||||
},
|
||||
[createSvgIcon('help-circle', { size: 13 })]
|
||||
);
|
||||
|
||||
ratePopoverEl.addEventListener?.('mouseenter', openRatePop);
|
||||
ratePopoverEl.addEventListener?.('mouseleave', scheduleRatePopClose);
|
||||
onCleanup?.(() => {
|
||||
cancelRatePopClose();
|
||||
});
|
||||
|
||||
function syncRatePopoverContent(data) {
|
||||
const sig = buildRatePopoverSig(data);
|
||||
if (sig === lastRatePopSig) return;
|
||||
lastRatePopSig = sig;
|
||||
|
||||
patchText(ratePopTitleEl, t('quota.ratePopTitle'));
|
||||
patchText(ratePopNoteEl, t('quota.ratePopNote'));
|
||||
patchAttr(rateHelpBtn, 'aria-label', t('quota.rateHelpAria'));
|
||||
|
||||
const acctMasked = maskAccountLabel(data?.account?.email || data?.account?.name || '');
|
||||
patchText(
|
||||
ratePopAccountEl,
|
||||
acctMasked
|
||||
? t('quota.ratePopAccountScope', { account: acctMasked })
|
||||
: t('quota.ratePopAccountCurrent')
|
||||
);
|
||||
patchAttr(ratePopAccountEl, 'title', acctMasked || null);
|
||||
|
||||
while (ratePopBodyEl.firstChild) {
|
||||
ratePopBodyEl.removeChild(ratePopBodyEl.firstChild);
|
||||
}
|
||||
|
||||
const rawPools = Array.isArray(data?.quotas?.pools) ? data.quotas.pools : [];
|
||||
const populatedGroups = [];
|
||||
|
||||
for (const p of rawPools) {
|
||||
const est = p?.rateEstimate;
|
||||
if (!est || typeof est !== 'object') continue;
|
||||
const models = Array.isArray(est.models) ? est.models : [];
|
||||
const hasPoolFallback =
|
||||
models.length === 0 &&
|
||||
(Number.isFinite(est.rate5hPctPerUsd) || Number.isFinite(est.rateWeeklyPctPerUsd));
|
||||
if (models.length === 0 && !hasPoolFallback) continue;
|
||||
|
||||
const poolLabel = p.poolLabel || p.family || p.poolKey || 'Pool';
|
||||
const rows =
|
||||
models.length > 0
|
||||
? models.map((item) =>
|
||||
createRateModelCard({
|
||||
name: item.model,
|
||||
multiplier: item.multiplier,
|
||||
rate5hPctPerUsd: item.rate5hPctPerUsd,
|
||||
rateWeeklyPctPerUsd: item.rateWeeklyPctPerUsd,
|
||||
eqFull5hUsd: item.eqFull5hUsd,
|
||||
eqFullWeeklyUsd: item.eqFullWeeklyUsd,
|
||||
samples: item.samples,
|
||||
})
|
||||
)
|
||||
: [
|
||||
createRateModelCard({
|
||||
name: t('quota.ratePopPoolFallback'),
|
||||
isMutedName: true,
|
||||
isFallback: true,
|
||||
rate5hPctPerUsd: est.rate5hPctPerUsd,
|
||||
rateWeeklyPctPerUsd: est.rateWeeklyPctPerUsd,
|
||||
eqFull5hUsd: est.eqFull5hUsd,
|
||||
eqFullWeeklyUsd: est.eqFullWeeklyUsd,
|
||||
samples: Math.max(Number(est.samples5h) || 0, Number(est.samplesWeekly) || 0),
|
||||
}),
|
||||
];
|
||||
|
||||
populatedGroups.push(
|
||||
h('div', { className: 'quota-rate-pool-group' }, [
|
||||
h('div', { className: 'quota-rate-pool-label', text: poolLabel }),
|
||||
h('div', { className: 'quota-rate-model-list' }, rows),
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
if (populatedGroups.length === 0) {
|
||||
ratePopBodyEl.appendChild(
|
||||
h('div', { className: 'quota-rate-pop-empty', text: t('quota.ratePopEmpty') })
|
||||
);
|
||||
} else {
|
||||
for (const grp of populatedGroups) {
|
||||
ratePopBodyEl.appendChild(grp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const poolsListEl = h(
|
||||
'div',
|
||||
compactHover
|
||||
@@ -453,22 +772,27 @@ export const QuotaPoolsWidget = defineComponent({
|
||||
]
|
||||
);
|
||||
|
||||
const quotaPanel = h('section', { className: 'panel' }, [
|
||||
const quotaPanel = h('section', { className: 'panel quota-panel' }, [
|
||||
h('div', { className: 'panel-header' }, [
|
||||
h('span', { className: 'panel-title' }, [
|
||||
createSvgIcon('pulse', { size: 13 }),
|
||||
titleTextEl,
|
||||
rateHelpBtn,
|
||||
]),
|
||||
tierBadge,
|
||||
]),
|
||||
poolsListEl,
|
||||
reserveLegendEl,
|
||||
ratePopoverEl,
|
||||
]);
|
||||
|
||||
syncRatePopoverContent(null);
|
||||
|
||||
function update({ data, minuteTick } = {}) {
|
||||
patchText(titleTextEl, t('module.quotas'));
|
||||
patchText(legendActualTextEl, t('quota.legendActual'));
|
||||
patchText(legendReservedTextEl, t('quota.legendReserved'));
|
||||
syncRatePopoverContent(data);
|
||||
if (!data) {
|
||||
reserveLegendEl.hidden = true;
|
||||
if (compactHover) {
|
||||
@@ -497,7 +821,7 @@ export const QuotaPoolsWidget = defineComponent({
|
||||
|
||||
return {
|
||||
el: quotaPanel,
|
||||
refs: { update, poolsListEl },
|
||||
refs: { update, poolsListEl, rateHelpBtn, ratePopoverEl },
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -200,6 +200,17 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
|
||||
'quota.footCallsCycle': 'Cycle Calls: {calls}',
|
||||
'quota.footTipCustom': 'Counted since Monday 00:00 local time',
|
||||
'quota.footTipCycle': 'Summed across each quota pool weekly reset window',
|
||||
'quota.rateHelpAria': 'View empirical burn-rate estimates for this account',
|
||||
'quota.ratePopTitle': 'Estimated Burn Rates',
|
||||
'quota.ratePopAccountScope': '{account}',
|
||||
'quota.ratePopAccountCurrent': 'Current account',
|
||||
'quota.ratePopPoolFallback': 'Pool average',
|
||||
'quota.ratePopEq5hLabel': '5h full',
|
||||
'quota.ratePopEqWkLabel': 'Weekly full',
|
||||
'quota.ratePopPerUsd': '{win} {rate}%/$',
|
||||
'quota.ratePopSamples': '{n} samples',
|
||||
'quota.ratePopEmpty': 'Not enough clean single-model samples yet (at least 3 clean steps per model). Estimates appear automatically during use.',
|
||||
'quota.ratePopNote': 'Measured from clean single-model steps; lowest burn in pool = 1x. Account isolated.',
|
||||
|
||||
// Live Activity Widget
|
||||
'live.currentSession': 'Current Session',
|
||||
|
||||
@@ -200,6 +200,17 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
|
||||
'quota.footCallsCycle': '周期调用: {calls} 次',
|
||||
'quota.footTipCustom': '按本机自然周(周一 00:00 起)统计',
|
||||
'quota.footTipCycle': '按各配额池独立周限重置周期分别统计并汇总',
|
||||
'quota.rateHelpAria': '查看当前账号实测倍率预估',
|
||||
'quota.ratePopTitle': '实测倍率预估',
|
||||
'quota.ratePopAccountScope': '{account}',
|
||||
'quota.ratePopAccountCurrent': '当前账号',
|
||||
'quota.ratePopPoolFallback': '池综合均值',
|
||||
'quota.ratePopEq5hLabel': '5h 满池',
|
||||
'quota.ratePopEqWkLabel': '周限满池',
|
||||
'quota.ratePopPerUsd': '{win} {rate}%/$',
|
||||
'quota.ratePopSamples': '{n} 样本',
|
||||
'quota.ratePopEmpty': '暂未采集到足够的单模型干净样本(每模型需至少 3 次无抖动扣费),正常使用后自动生成。',
|
||||
'quota.ratePopNote': '按单模型纯净步实测折算,同池最省为 1x,按账号隔离。',
|
||||
|
||||
// Live Activity Widget
|
||||
'live.currentSession': '当前会话',
|
||||
|
||||
@@ -22,6 +22,11 @@ export const SVG_ICON_DEFS = Object.freeze({
|
||||
{ tag: 'path', attrs: { d: 'M8 6.2v3.4' } },
|
||||
{ tag: 'circle', attrs: { cx: '8', cy: '11.5', r: '0.6', fill: 'currentColor', stroke: 'none' } },
|
||||
],
|
||||
'help-circle': [
|
||||
{ tag: 'circle', attrs: { cx: '8', cy: '8', r: '6' } },
|
||||
{ tag: 'path', attrs: { d: 'M6.2 6.3a1.9 1.9 0 0 1 3.6.7c0 1.15-1.8 1.35-1.8 2.5' } },
|
||||
{ tag: 'circle', attrs: { cx: '8', cy: '11.8', r: '0.65', fill: 'currentColor', stroke: 'none' } },
|
||||
],
|
||||
'chevron-down': [
|
||||
{ tag: 'path', attrs: { d: 'M4 6.2l4 4 4-4' } },
|
||||
],
|
||||
|
||||
@@ -1105,7 +1105,9 @@ export function isEquivalentTelemetry(prev, next) {
|
||||
pPools[i]?.cycle5h?.calls !== nPools[i]?.cycle5h?.calls ||
|
||||
pPools[i]?.cycleWeekly?.tokens !== nPools[i]?.cycleWeekly?.tokens ||
|
||||
pPools[i]?.cycleWeekly?.costUsd !== nPools[i]?.cycleWeekly?.costUsd ||
|
||||
pPools[i]?.cycleWeekly?.calls !== nPools[i]?.cycleWeekly?.calls
|
||||
pPools[i]?.cycleWeekly?.calls !== nPools[i]?.cycleWeekly?.calls ||
|
||||
JSON.stringify(pPools[i]?.rateEstimate || null) !==
|
||||
JSON.stringify(nPools[i]?.rateEstimate || null)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -813,7 +813,9 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
||||
[data-modern-ui="true"] .trend-tooltip,
|
||||
[data-modern-ui="true"] .cons-breakdown-popover,
|
||||
[data-modern-ui="true"] .turn-prompt-tip,
|
||||
[data-modern-ui="true"] .step-anomaly-tip {
|
||||
[data-modern-ui="true"] .step-anomaly-tip,
|
||||
[data-modern-ui="true"] .quota-rate-popover,
|
||||
:host([data-modern-ui="true"]) .quota-rate-popover {
|
||||
border: none;
|
||||
background: var(--modern-surface-card);
|
||||
box-shadow: var(--shadow-popover);
|
||||
@@ -821,8 +823,16 @@ html[data-standalone="true"][data-modern-ui="true"] .app-shell {
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .step-anomaly-tip-list,
|
||||
[data-modern-ui="true"] .step-anomaly-tip-hint {
|
||||
border-top-color: var(--modern-surface-hover);
|
||||
[data-modern-ui="true"] .step-anomaly-tip-hint,
|
||||
[data-modern-ui="true"] .quota-rate-pop-head,
|
||||
[data-modern-ui="true"] .quota-rate-pool-group + .quota-rate-pool-group,
|
||||
[data-modern-ui="true"] .quota-rate-model-row + .quota-rate-model-row,
|
||||
[data-modern-ui="true"] .quota-rate-pop-note,
|
||||
:host([data-modern-ui="true"]) .quota-rate-pop-head,
|
||||
:host([data-modern-ui="true"]) .quota-rate-pool-group + .quota-rate-pool-group,
|
||||
:host([data-modern-ui="true"]) .quota-rate-model-row + .quota-rate-model-row,
|
||||
:host([data-modern-ui="true"]) .quota-rate-pop-note {
|
||||
border-color: var(--modern-surface-hover);
|
||||
}
|
||||
|
||||
[data-modern-ui="true"] .trend-tooltip:not(.is-hm-top):not(.is-hm-bottom) {
|
||||
|
||||
@@ -645,6 +645,226 @@
|
||||
);
|
||||
}
|
||||
|
||||
/* 可用额度标题旁圈问号触发器及实测倍率预估悬浮卡片 */
|
||||
.quota-panel {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.quota-rate-help-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
padding: 0;
|
||||
margin-left: -1px;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: help;
|
||||
flex-shrink: 0;
|
||||
transition:
|
||||
color var(--dur-instant) var(--ease-fast),
|
||||
background-color var(--dur-instant) var(--ease-fast);
|
||||
}
|
||||
|
||||
.quota-rate-help-btn:hover,
|
||||
.quota-rate-help-btn:focus-visible,
|
||||
.quota-rate-help-btn.is-open {
|
||||
color: var(--accent-primary);
|
||||
background: var(--accent-primary-soft);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.quota-rate-popover {
|
||||
position: absolute;
|
||||
top: 38px;
|
||||
left: 12px;
|
||||
width: min(332px, calc(100% - 24px));
|
||||
z-index: 45;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
background: var(--surface-panel);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius-sm);
|
||||
box-shadow: var(--shadow-popover);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.quota-rate-popover[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.quota-rate-pop-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
padding-bottom: 6px;
|
||||
border-bottom: 1px solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.quota-rate-pop-title {
|
||||
font-size: var(--fs-base-sm);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.quota-rate-pop-account {
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.quota-rate-pop-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.quota-rate-pool-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.quota-rate-pool-group + .quota-rate-pool-group {
|
||||
padding-top: 7px;
|
||||
border-top: 1px solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.quota-rate-pool-label {
|
||||
font-size: var(--fs-2xs);
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.quota-rate-model-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.quota-rate-model-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.quota-rate-model-row + .quota-rate-model-row {
|
||||
padding-top: 7px;
|
||||
border-top: 1px solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.quota-rate-row-top {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.quota-rate-model-left {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.quota-rate-model-name {
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.quota-rate-model-name.is-muted {
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.quota-rate-mult-badge {
|
||||
font-family: var(--font-mono);
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.quota-rate-mult-badge.is-high {
|
||||
color: var(--metric-warn);
|
||||
}
|
||||
|
||||
.quota-rate-meta {
|
||||
font-size: var(--fs-2xs);
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.quota-rate-eq-grid {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.quota-rate-eq-grid.is-single {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.quota-rate-eq-cell {
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
gap: 5px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.quota-rate-eq-k {
|
||||
font-size: var(--fs-xs);
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.quota-rate-eq-v {
|
||||
font-size: var(--fs-sm);
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.quota-rate-pop-empty {
|
||||
font-size: var(--fs-sm);
|
||||
line-height: 1.5;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.quota-rate-pop-note {
|
||||
padding-top: 6px;
|
||||
border-top: 1px solid var(--border-hairline);
|
||||
font-size: var(--fs-2xs);
|
||||
line-height: 1.45;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* --- 4. 上下文双列图例网格 (Context 10-Channel Legend Grid) --- */
|
||||
.ctx-legend-grid {
|
||||
display: grid;
|
||||
|
||||
Reference in New Issue
Block a user