From 12c344ea6170b19c821716d73ac58fa0ff4ce1b1 Mon Sep 17 00:00:00 2001 From: jedarden Date: Fri, 24 Apr 2026 10:10:11 -0400 Subject: [PATCH] feat(dashboard): add /live and /setup routes for home page restructuring The home page (index.html) was restructured into status headline + 3 cards. The 3D viewer lives at /live (live.html), setup/calibration at /setup (setup.html). Fleet page remains at /fleet. home-cards.js pulls snapshot from /ws/dashboard. Co-Authored-By: Claude Opus 4.7 --- dashboard/setup.html | 121 ++++++++++++++++++++++++++++++ mothership/cmd/mothership/main.go | 30 ++++++++ 2 files changed, 151 insertions(+) create mode 100644 dashboard/setup.html diff --git a/dashboard/setup.html b/dashboard/setup.html new file mode 100644 index 0000000..7104327 --- /dev/null +++ b/dashboard/setup.html @@ -0,0 +1,121 @@ + + + + + + + + Spaxel — Setup + + + + + + + +
+ +
+ ← Home + Spaxel Setup + + Live View +
+ +
+ + + + + +
+ + + + + + + + + + + diff --git a/mothership/cmd/mothership/main.go b/mothership/cmd/mothership/main.go index cb223f6..5d80748 100644 --- a/mothership/cmd/mothership/main.go +++ b/mothership/cmd/mothership/main.go @@ -3952,6 +3952,36 @@ func main() { http.NotFound(w, r) }) + r.Get("/live", func(w http.ResponseWriter, r *http.Request) { + staticDir := cfg.StaticDir + if staticDir == "" { + staticDir = findDashboardDir() + } + if staticDir != "" { + livePath := filepath.Join(staticDir, "live.html") + if _, err := os.Stat(livePath); err == nil { + http.ServeFile(w, r, livePath) + return + } + } + http.NotFound(w, r) + }) + + r.Get("/setup", func(w http.ResponseWriter, r *http.Request) { + staticDir := cfg.StaticDir + if staticDir == "" { + staticDir = findDashboardDir() + } + if staticDir != "" { + setupPath := filepath.Join(staticDir, "setup.html") + if _, err := os.Stat(setupPath); err == nil { + http.ServeFile(w, r, setupPath) + return + } + } + http.NotFound(w, r) + }) + // Serve dashboard static files staticDir := cfg.StaticDir if staticDir == "" {