From 46b10af87e1d8047abcbab40a081299c1cd23fd1 Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 8 Nov 2026 02:29:24 +0800 Subject: [PATCH] gui: About's MAGPIE_PUBLIC_URL label is the gateway plugin's, back under the core's script budget 9451ad59f put the About row's addrWho call in app.js, which took the core's scripts to 1,533,884, 82 bytes over their 1,533,802 budget (TestCoreScriptBudget, red on main since). The call moves into the gateway plugin as pubWho(s) (plugins/gateway/settings.js), app.js keeps one line for it, and the core is 1,533,587, no raise. The label itself is unchanged. Run, on mote (sandbox HOME): - red before: 9451ad59f's full go test -tags nogui ./... through suite.lock: every package ok except internal/gui, TestCoreScriptBudget "1533884 bytes, over their budget of 1533802" (87 packages ok). - at this head (on 7a2946caf): go test -run 'Budget|URLKind|PublicURL|LAN|Container' ./internal/gui ./internal/gateway, and GUI lan-docker, public-url-default, public-url, lan-public, i18n-keys in chromium and webkit: go ok; GUI 89/90, the one red i18n-keys' "a plugin's words are its own" (library, routing, usage words; none of this change's), filed in #5332, #5327, #5482, #5426 Not tried: the full suite again at this head (it was queued behind the lock); only internal/gui's budget changed. --- internal/gui/assets/app.js | 7 ++----- internal/gui/assets/plugins/gateway/settings.js | 6 ++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 6b8697595..03440026c 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -20088,12 +20088,9 @@ function renderSettings() { const cmd = "curl -fsS -m 1 -H 'Authorization: Bearer ' --data-binary @- " + gw + "/v1/magpie/statusline || true"; row(t("Status line on another computer"), t("statusLine's command in Claude Code's settings.json there; a read-only gateway key is enough"), cmd, copyBtn(cmd, t("Command"))).id = "statuslineRemoteRow"; } - // MAGPIE_PUBLIC_URL, where other machines reach it (#1551), named as - // the Gateway page names it (addrWho): a private address is the local - // network's, not "Public address" (jiezhengj on Discord) + // MAGPIE_PUBLIC_URL (#1551), named as the Gateway page names it if (s.publicURL && gw !== s.publicURL) { - const who = self.addrWho?.({ url: s.gateway, publicURL: s.publicURL, publicKind: s.publicKind, lanPublic: s.lanPublic }, s.publicURL, - s.lanContainerHost ? [s.lanContainerHost] : []) || t("Public address"); + const who = self.pubWho?.(s) || t("Public address"); row(who, t("MAGPIE_PUBLIC_URL: where other computers reach the gateway, with a gateway key"), s.publicURL, copyBtn(s.publicURL, who)).id = "publicURLRow"; } const site = el("button", "text", t("Open")); diff --git a/internal/gui/assets/plugins/gateway/settings.js b/internal/gui/assets/plugins/gateway/settings.js index 605bd2f31..4cb33a589 100644 --- a/internal/gui/assets/plugins/gateway/settings.js +++ b/internal/gui/assets/plugins/gateway/settings.js @@ -314,6 +314,12 @@ function addrWho(g, u, others = []) { if (u === g.publicURL && g.publicKind !== "local") return t("Public address"); return t("Local network"); } +// pubWho: About's MAGPIE_PUBLIC_URL row, from /api/settings, by addrWho +// (a private address is the local network's; jiezhengj on Discord) +function pubWho(s) { + return addrWho({ url: s.gateway, publicURL: s.publicURL, publicKind: s.publicKind, lanPublic: s.lanPublic }, s.publicURL, + s.lanContainerHost ? [s.lanContainerHost] : []); +} // gwFar: where other machines reach the gateway, for the sidebar and the // key page: other containers' address only when there is no other function gwFar(g) {