Web UI redesigned for datacenter fleets
Sidebar navigation (Overview, Machines, Jobs, Tags, Profiles, OS images); machine list with state/tag chips, search, sort, paging and multi-select bulk actions (power, deploy, assign, tag, re-commission, release, boot device); machine detail with tabs (overview, hardware, network, BMC, jobs, events, raw) and dialog-driven actions; fleet-wide /api/v1/events and /api/v1/jobs; ?token= sign-in; GPU count in summaries counts real accelerators only; OS catalog ignores dot-directories. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f798d8797
commit
0333c1e486
8 files changed
+619
-396
No files matched your search
+18
-1
@@ -129,6 +129,23 @@ func (a *App) routes() http.Handler {
|
||||
mux.HandleFunc("GET /api/v1/jobs/self", a.handleJobSelf) // job token auth inside
|
||||
mux.HandleFunc("POST /api/v1/jobs/self/progress", a.handleJobProgress) // job token auth inside
|
||||
mux.HandleFunc("POST /api/v1/phone-home/{token}", a.handlePhoneHome)
|
||||
// fleet-wide views for the UI
|
||||
mux.HandleFunc("GET /api/v1/events", a.adminAuth(func(w http.ResponseWriter, r *http.Request) {
|
||||
evs, err := a.store.RecentEvents(r.Context(), 100)
|
||||
if err != nil {
|
||||
fail(w, 500, err)
|
||||
return
|
||||
}
|
||||
writeJSON(w, 200, evs)
|
||||
}))
|
||||
mux.HandleFunc("GET /api/v1/jobs", a.adminAuth(func(w http.ResponseWriter, r *http.Request) {
|
||||
jobs, err := a.store.RecentJobs(r.Context(), 100)
|
||||
if err != nil {
|
||||
fail(w, 500, err)
|
||||
return
|
||||
}
|
||||
writeJSON(w, 200, jobs)
|
||||
}))
|
||||
// tags
|
||||
mux.HandleFunc("GET /api/v1/tags", a.adminAuth(a.handleTags))
|
||||
mux.HandleFunc("POST /api/v1/tags", a.adminAuth(a.handleTags))
|
||||
@@ -262,7 +279,7 @@ func summarize(m *Machine) Summary {
|
||||
CPU: str(dig(inv, "cpu", "Model name")), CPUs: str(dig(inv, "cpu", "CPU(s)")),
|
||||
MemoryBytes: num(dig(inv, "memory", "total_bytes")), Disks: num(dig(inv, "storage", "disk_count")),
|
||||
StorageBytes: num(dig(inv, "storage", "total_bytes")), NICs: listLen(inv["network"]),
|
||||
IBHCAs: listLen(dig(inv, "infiniband", "hcas")), GPUs: listLen(inv["gpus"]),
|
||||
IBHCAs: listLen(dig(inv, "infiniband", "hcas")), GPUs: nodeCtx(m).GPUs, // real accelerators only
|
||||
Profile: m.Profile, NodeName: m.NodeName, MgmtIP: m.MgmtIP, IBIP: m.IBIP, BootedAt: m.BootedAt,
|
||||
OS: m.OS, OSVersion: m.OSVersion, DeployedAt: m.DeployedAt,
|
||||
Tags: effectiveTags(m), ManualTags: m.Tags, AutoTags: m.AutoTags}
|
||||
|
||||
Reference in new issue
Block a user