Simulation Details page layout Update

This commit is contained in:
2026-02-23 22:03:52 -05:00
parent 5b2b0cbb1f
commit c0b62300f3
11 changed files with 527 additions and 92 deletions

View File

@@ -18,6 +18,17 @@ func NewRouter(db *sql.DB) *Router {
func (rt *Router) Register(mux *http.ServeMux) {
mux.HandleFunc("/api/simulations", rt.handleSimulationsBase)
mux.HandleFunc("/api/simulations/", rt.handleSimulationsPath)
mux.HandleFunc("/api/stats", func(w http.ResponseWriter, r *http.Request) {
if r.Method == "OPTIONS" {
rt.OptionsHandler(w, r)
return
}
if r.Method == "GET" {
rt.GetStats(w, r)
} else {
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
}
})
}
func (rt *Router) handleSimulationsBase(w http.ResponseWriter, r *http.Request) {
@@ -49,6 +60,11 @@ func (rt *Router) handleSimulationsPath(w http.ResponseWriter, r *http.Request)
return
}
if pathParts[0] == "clear-fails" && r.Method == "DELETE" {
rt.ClearFailedSimulations(w, r)
return
}
idStr := pathParts[0]
if len(pathParts) == 1 {