ui: embed reanimator chart viewer
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"git.mchus.pro/mchus/logpile/internal/collector"
|
||||
"git.mchus.pro/mchus/logpile/internal/models"
|
||||
chartviewer "reanimator/chart/viewer"
|
||||
)
|
||||
|
||||
// WebFS holds embedded web files (set by main package)
|
||||
@@ -64,9 +65,13 @@ func (s *Server) setupRoutes() {
|
||||
panic(err)
|
||||
}
|
||||
s.mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(staticContent))))
|
||||
s.mux.Handle("/chart/", http.StripPrefix("/chart", chartviewer.NewHandler(chartviewer.HandlerOptions{
|
||||
Title: "LOGPile Reanimator Viewer",
|
||||
})))
|
||||
|
||||
// Pages
|
||||
s.mux.HandleFunc("/", s.handleIndex)
|
||||
s.mux.HandleFunc("GET /chart/current", s.handleChartCurrent)
|
||||
|
||||
// API endpoints
|
||||
s.mux.HandleFunc("POST /api/upload", s.handleUpload)
|
||||
|
||||
Reference in New Issue
Block a user