Simulation Details page layout Update
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user