From 3c9054830d1eb0107467b4202ad5b114c0800b4d Mon Sep 17 00:00:00 2001 From: kim Date: Sat, 17 Oct 2026 22:39:59 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=EC=9A=A9=20=ED=8C=A8=EB=84=90:=20?= =?UTF-8?q?=EA=B8=B0=EA=B0=84=20=EB=B0=96=20=EB=AA=A8=EB=8D=B8(=ED=98=B8?= =?UTF-8?q?=EC=B6=9C=200)=20=ED=96=89=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src/providers/cost-estimate.ts | 1 + web-ui/js/app/settings-provider.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/providers/cost-estimate.ts b/src/providers/cost-estimate.ts index 2671991..a14a61e 100644 --- a/src/providers/cost-estimate.ts +++ b/src/providers/cost-estimate.ts @@ -79,6 +79,7 @@ export function summarize(rows: UsageRow[], billing: BillingState = {}, now: Dat if (day >= weekAgo) { add(out.last7, r, usd); out.daily[day] = (out.daily[day] || 0) + (usd ?? 0); } if (day.startsWith(monthPrefix) || day >= weekAgo) add(bm, r, usd); } + for (const [m, b] of Object.entries(out.byModel)) if (b.calls === 0) delete out.byModel[m]; // 이번 달·7일 밖 모델은 표에서 뺀다 // 앤트로픽 잔액 추산: 사용자가 콘솔에서 확인해 입력한 잔액 − 그 시점 이후 claude 호출의 추산 지출 let anthropic: null | { balance_usd: number; as_of: string; spent_since: number; estimated_balance: number; warn_below_usd: number; low: boolean } = null; if (typeof billing.balance_usd === 'number' && billing.as_of) { diff --git a/web-ui/js/app/settings-provider.js b/web-ui/js/app/settings-provider.js index d8e8df5..1aa3da8 100644 --- a/web-ui/js/app/settings-provider.js +++ b/web-ui/js/app/settings-provider.js @@ -1598,7 +1598,7 @@ async function loadCostPanel() { const d = await api('/api/usage/cost'); totals.innerHTML = ['today:오늘', 'last7:최근 7일', 'month:이번 달'] .map(x => { const [k, label] = x.split(':'); return '' + label + ' ' + _fmtUsd(d[k].usd) + ' · ' + d[k].calls + '회'; }).join(''); - const rows = Object.entries(d.byModel).sort((a, b) => b[1].usd - a[1].usd || b[1].calls - a[1].calls).slice(0, 12); + const rows = Object.entries(d.byModel).filter(([, b]) => b.calls > 0).sort((a, b) => b[1].usd - a[1].usd || b[1].calls - a[1].calls).slice(0, 12); table.innerHTML = '모델 (최근 7일·이번 달)호출입력출력추산' + rows.map(([m, b]) => '' + escHtml(m) + '' + b.calls + '' + _fmtTok(b.promptTokens) + '' + _fmtTok(b.completionTokens) + '' + (b.priced ? _fmtUsd(b.usd) : '정액/로컬') + '').join('');