diff options
-rw-r--r-- | cmd/monfront/main.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd/monfront/main.go b/cmd/monfront/main.go index 9cb906a..f7bdaa4 100644 --- a/cmd/monfront/main.go +++ b/cmd/monfront/main.go @@ -270,7 +270,11 @@ func showChecks(w http.ResponseWriter, r *http.Request) { if len(where) > 0 { query += " where " + strings.Join(where, " and ") } - query += ` order by n.name, co.name` + if strings.HasPrefix(r.URL.Path, "/unhandled") { + query += ` order by ac.states[1] desc, n.name, co.name` + } else { + query += ` order by n.name, co.name` + } rows, err := DB.Query(query, params...) if err != nil { w.WriteHeader(http.StatusInternalServerError) @@ -335,6 +339,12 @@ func showGroups(w http.ResponseWriter, r *http.Request) { return } + if strings.HasPrefix(r.URL.Path, "/unhandled") { + query += ` order by maxstate desc, g.name, n.name` + } else { + query += ` order by g.name, n.name` + } + groups := []group{} for rows.Next() { g := group{} |