Machine menu shows each machine's address instead of its load

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Mitchell-Johnson
2026-09-19 10:45:24 -07:00
co-authored by Claude Fable 5.1
parent d3f2a83249
commit a838adcb27
4 changed files with 16 additions and 9 deletions
+8 -3
View File
@@ -745,12 +745,17 @@ func (s *Server) me(w http.ResponseWriter, _ *http.Request) {
}
}
_, rebootErr := os.Stat("/run/reboot-required")
var demoURL string
s.cfg.View(func(c *config.Config) { demoURL = c.DemoURL })
var demoURL, addr string
s.cfg.View(func(c *config.Config) {
demoURL = c.DemoURL
if h, _, err := net.SplitHostPort(c.Listen); err == nil && h != "" && h != "0.0.0.0" && h != "::" {
addr = h // the address this console listens on, for the machine menu
}
})
jsonOK(w, 200, map[string]any{
"host": s.host, "user": s.user, "version": s.version,
"load": load, "uptime": uptime, "service_started": s.started,
"reboot_needed": rebootErr == nil, "fingerprint": s.fingerprint, "arch": runtime.GOARCH, "demo_url": demoURL,
"reboot_needed": rebootErr == nil, "fingerprint": s.fingerprint, "arch": runtime.GOARCH, "demo_url": demoURL, "addr": addr,
})
}