usage: the quick panel and the Usage page word unpriced calls alike

The quick panel's Cost said "15 个没有价格" while the Usage page's
said "15 次调用没有已知价格,未计入". Both now say "{n} calls unpriced"
("15 次调用未计价"), as the page's other cost heads already did, with
the whole sentence on hover.

Reported-by: tenacious_eagle on Discord

The Usage page's plugin already had the two count keys; they live in the
core's i18n.js now that the quick panel says them too (i18n-keys: no key
twice, a plugin's words are its own). The Overview calls tile says the
same words, so usage-unpriced-sum's tile wording follows.

Run on mote at origin/main fc9ce34d8 + this: gofmt -l internal clean;
node --test i18n-keys, i18n-en-no-cjk, panel-usage, tray-totals,
usage-unpriced-names, usage-unpriced-sum, usage-stat-sub-wrap, currency,
usage-compact-counts 126/126; go test ./internal/gui ok (TestCoreScriptBudget
under its budget, not raised). usage-ledger's "newest live route needs no
return-to-live button" is red alone on fc9ce34d8 too (#3104, #5048).
This commit is contained in:
yetone
2026-11-10 00:13:32 +08:00
parent ac4af58230
commit ecc16fe979
5 changed files with 20 additions and 20 deletions
+3 -1
View File
@@ -17414,7 +17414,9 @@ function renderPanelUse() {
blk("Tokens", fmtN(allTokens(l)), t("{a} in · {b} out", { a: fmtN(l.input), b: fmtN(l.output) }) + (cached ? " · " + t("{n} cached", { n: fmtN(cached) }) : ""), "", "", ledNum(allTokens(l)));
blk("Requests", fmtN(l.calls), [l.errors ? t("{n} failed", { n: fmtN(l.errors) }) : t("none failed"), l.retried ? t("{n} answered on a retry", { n: fmtN(l.retried) }) : ""].filter(Boolean).join(" · "), "", l.errors ? "bad" : "", ledNum(l.calls));
const c = fmtCost(l);
blk("Cost", c ? "≈" + c : "—", l.unpriced ? t("{n} unpriced", { n: l.unpriced }) : t("effective prices"), c ? "cost" : "");
// as the Usage page words it, the sentence on hover
const u = l.unpriced, one = u === 1;
blk("Cost", c ? "≈" + c : "—", u ? t(one ? "{n} call unpriced" : "{n} calls unpriced", { n: u }) : t("effective prices"), c ? "cost" : "", "", u ? t(one ? "{n} call had no known price and is not counted" : "{n} calls had no known price and are not counted", { n: u }) : "");
blk("Cache hit rate", hitRate === null ? "—" : Math.round(100 * hitRate) + "%", cacheLeftOut(l) || t("of the prompt"));
const card = el("div", "pu-card");
const head = el("div", "led-bar");
+8 -4
View File
@@ -3329,7 +3329,8 @@ const I18N = {
"No requests today": "今天还没有请求",
"No requests here": "这里没有请求",
"Every request an agent sends to magpie, and every call the agents' own session files record, is counted here.": "统计 Agent 发给 magpie 的每个请求,以及 Agent 会话文件记录的每次调用。",
"{n} unpriced": "{n} 个没有价格",
"{n} call unpriced": "{n} 次调用未计价",
"{n} calls unpriced": "{n} 次调用未计价",
"of the prompt": "占提示词",
"Provider": "供应商",
"All providers": "全部供应商",
@@ -8098,7 +8099,8 @@ const I18N = {
"No requests today": "今天還沒有請求",
"No requests here": "這裡沒有請求",
"Every request an agent sends to magpie, and every call the agents' own session files record, is counted here.": "統計 Agent 發給 magpie 的每個請求,以及 Agent 會話檔案記錄的每次呼叫。",
"{n} unpriced": "{n} 個沒有價格",
"{n} call unpriced": "{n} 次呼叫未計價",
"{n} calls unpriced": "{n} 次呼叫未計價",
"of the prompt": "佔提示詞",
"Provider": "供應商",
"All providers": "全部供應商",
@@ -12868,7 +12870,8 @@ const I18N = {
"No requests today": "今日のリクエストはまだありません",
"No requests here": "ここにはリクエストがありません",
"Every request an agent sends to magpie, and every call the agents' own session files record, is counted here.": "エージェントが magpie に送ったすべてのリクエストと、エージェント自身のセッションファイルに記録されたすべての呼び出しがここに集計されます。",
"{n} unpriced": "{n} 件は価格不明",
"{n} call unpriced": "{n} 件の呼び出しは価格不明",
"{n} calls unpriced": "{n} 件の呼び出しは価格不明",
"of the prompt": "プロンプトのうち",
"Provider": "プロバイダ",
"All providers": "すべてのプロバイダ",
@@ -17649,7 +17652,8 @@ const I18N = {
"No requests today": "Heute keine Anfragen",
"No requests here": "Hier keine Anfragen",
"Every request an agent sends to magpie, and every call the agents' own session files record, is counted here.": "Jede Anfrage eines Agenten an magpie und jeder Aufruf aus den Sitzungsdateien der Agenten wird hier gezählt.",
"{n} unpriced": "{n} ohne Preis",
"{n} call unpriced": "{n} Aufruf ohne Preis",
"{n} calls unpriced": "{n} Aufrufe ohne Preis",
"of the prompt": "des Prompts",
"Provider": "Anbieter",
"All providers": "Alle Anbieter",
@@ -114,8 +114,6 @@ magpie.strings({
"Updated {time}": "更新于 {time}",
"Model recorded in the local session log; the outbound HTTP request was not captured.": "本地会话日志记录的模型;未采集实际发出的 HTTP 请求。",
"About: told from the session file's times, a little more or less than it took": "估算值:按会话文件中的时间计算,与实际耗时略有出入",
"{n} call unpriced": "{n} 次调用未计价",
"{n} calls unpriced": "{n} 次调用未计价",
"{n} model unpriced": "{n} 个模型未计价",
"{n} models unpriced": "{n} 个模型未计价",
"Show only the requests answered on a retry": "只看重试后成功的请求",
@@ -359,8 +357,6 @@ magpie.strings({
"Updated {time}": "更新於 {time}",
"Model recorded in the local session log; the outbound HTTP request was not captured.": "本地會話日誌記錄的模型;未採集實際發出的 HTTP 請求。",
"About: told from the session file's times, a little more or less than it took": "估算值:按會話檔案中的時間計算,與實際耗時略有出入",
"{n} call unpriced": "{n} 次呼叫未計價",
"{n} calls unpriced": "{n} 次呼叫未計價",
"{n} model unpriced": "{n} 個模型未計價",
"{n} models unpriced": "{n} 個模型未計價",
"Show only the requests answered on a retry": "只看重試後成功的請求",
@@ -604,8 +600,6 @@ magpie.strings({
"Updated {time}": "{time} に更新",
"Model recorded in the local session log; the outbound HTTP request was not captured.": "ローカルのセッションログに記録されたモデルです。実際に送信された HTTP リクエストは取得していません。",
"About: told from the session file's times, a little more or less than it took": "概算:セッションファイルの時刻から算出しており、実際の所要時間とは多少ずれます",
"{n} call unpriced": "{n} 件の呼び出しは価格不明",
"{n} calls unpriced": "{n} 件の呼び出しは価格不明",
"{n} model unpriced": "{n} 個のモデルは価格不明",
"{n} models unpriced": "{n} 個のモデルは価格不明",
"Show only the requests answered on a retry": "再試行で成功したリクエストだけを表示",
@@ -849,8 +843,6 @@ magpie.strings({
"Updated {time}": "Aktualisiert {time}",
"Model recorded in the local session log; the outbound HTTP request was not captured.": "Modell laut lokalem Sitzungslog; die ausgehende HTTP-Anfrage wurde nicht erfasst.",
"About: told from the session file's times, a little more or less than it took": "Ungefähr: aus den Zeiten der Sitzungsdatei ermittelt, etwas mehr oder weniger als die tatsächliche Dauer",
"{n} call unpriced": "{n} Aufruf ohne Preis",
"{n} calls unpriced": "{n} Aufrufe ohne Preis",
"{n} model unpriced": "{n} Modell ohne Preis",
"{n} models unpriced": "{n} Modelle ohne Preis",
"Show only the requests answered on a retry": "Nur die nach erneutem Versuch beantworteten Anfragen zeigen",
+4 -2
View File
@@ -730,7 +730,7 @@ function renderUsage() {
const hit = u.cache_read && hitRate !== null ? t("hit rate {p}", { p: Math.round(100 * hitRate) + "%" }) : "";
tile(fmtN(u.cache_read), t("cache read"), hit, u.cache_write ? t("{n} written", { n: fmtN(u.cache_write) }) + cacheTTLs(u, fmtN) : "");
tile(fmtN(u.reasoning), t("reasoning"), t("inside output"));
tile(String(u.calls), t(u.calls === 1 ? "call" : "calls"), [u.credited ? ledCredits(u).textContent : "", u.errors ? t("{n} failed", { n: u.errors }) : "", u.retried ? t("{n} answered on a retry", { n: u.retried }) : "", u.canceled ? t("{n} canceled", { n: u.canceled }) : "", u.unpriced ? t("{n} unpriced", { n: u.unpriced }) : ""].filter(Boolean).join(" · "), u.unpriced ? unpricedCallsWhy(u.unpriced) : "");
tile(String(u.calls), t(u.calls === 1 ? "call" : "calls"), [u.credited ? ledCredits(u).textContent : "", u.errors ? t("{n} failed", { n: u.errors }) : "", u.retried ? t("{n} answered on a retry", { n: u.retried }) : "", u.canceled ? t("{n} canceled", { n: u.canceled }) : "", u.unpriced ? unpricedCalls(u.unpriced) : ""].filter(Boolean).join(" · "), u.unpriced ? unpricedCallsWhy(u.unpriced) : "");
// the timeline: one bar per hour, day or week; output sits on top of input
const chart = $("#chart");
@@ -1699,7 +1699,9 @@ function renderLedgerDash(l) {
strip.lastChild.append(io);
}
const c = fmtCost(l);
block("Cost", c ? "≈" + c : "—", line(l.unpriced ? t(l.unpriced === 1 ? "{n} call had no known price and is not counted" : "{n} calls had no known price and are not counted", { n: l.unpriced }) : t("effective prices")), c ? "cost" : "");
// the count in the words the quick panel uses too, the whole sentence on
// hover (tenacious_eagle on Discord)
block("Cost", c ? "≈" + c : "—", line(l.unpriced ? unpricedCalls(l.unpriced) : t("effective prices")), c ? "cost" : "", l.unpriced ? unpricedCallsWhy(l.unpriced) : "");
const hit = block("Cache hit rate", rate === null ? "—" : (100 * rate).toFixed(1) + "%", cacheLeftOut(l) ? line(cacheLeftOut(l)) : null, "", t("The share of the prompt read from the cache"));
const meter = el("div", "meter"), fill = el("i");
fill.style.width = (100 * (rate || 0)).toFixed(1) + "%";
@@ -20,11 +20,11 @@ const today = new Date().toISOString().slice(0, 10);
const at = (min) => new Date(Date.now() - min * 60e3).toISOString();
const want = {
en: { calls: "2 calls unpriced", tile: "2 unpriced", models: "1 model unpriced" },
zh: { calls: "2 次调用未计价", tile: "2 个没有价格", models: "1 个模型未计价" },
"zh-TW": { calls: "2 次呼叫未計價", tile: "2 個沒有價格", models: "1 個模型未計價" },
ja: { calls: "2 件の呼び出しは価格不明", tile: "2 件は価格不明", models: "1 個のモデルは価格不明" },
de: { calls: "2 Aufrufe ohne Preis", tile: "2 ohne Preis", models: "1 Modell ohne Preis" },
en: { calls: "2 calls unpriced", tile: "2 calls unpriced", models: "1 model unpriced" },
zh: { calls: "2 次调用未计价", tile: "2 次调用未计价", models: "1 个模型未计价" },
"zh-TW": { calls: "2 次呼叫未計價", tile: "2 次呼叫未計價", models: "1 個模型未計價" },
ja: { calls: "2 件の呼び出しは価格不明", tile: "2 件の呼び出しは価格不明", models: "1 個のモデルは価格不明" },
de: { calls: "2 Aufrufe ohne Preis", tile: "2 Aufrufe ohne Preis", models: "1 Modell ohne Preis" },
};
// some: one call priced, two of Kimi K3 Auto not; none: only those two