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:
co-authored by
Claude Fable 5.1
parent
d3f2a83249
commit
a838adcb27
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user