diff --git a/go.mod b/go.mod index 35dfa07..41563fd 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module gitea.inhome.blapointe.com/local/firestormy -go 1.17 +go 1.22 require ( gitea.inhome.blapointe.com/local/args v0.0.0-20240109214601-658deda479a4 diff --git a/server/list.go b/server/list.go index 5873ed8..bd6ab32 100755 --- a/server/list.go +++ b/server/list.go @@ -2,12 +2,13 @@ package server import ( "encoding/json" + "net/http" + "sort" + "gitea.inhome.blapointe.com/local/firestormy/config" "gitea.inhome.blapointe.com/local/firestormy/config/ns" "gitea.inhome.blapointe.com/local/firestormy/scheduler" "gitea.inhome.blapointe.com/local/logb" - "net/http" - "sort" ) func (s *Server) list(w http.ResponseWriter, r *http.Request) { @@ -34,6 +35,12 @@ func (s *Server) list(w http.ResponseWriter, r *http.Request) { out[i] = toMap(j, false) } sort.Slice(out, func(i, j int) bool { + if out[i]["disabled"].(bool) == out[j]["disabled"].(bool) { + } else if out[i]["disabled"].(bool) { + return false + } else if out[j]["disabled"].(bool) { + return true + } return out[i]["title"].(string) < out[j]["title"].(string) }) json.NewEncoder(w).Encode(out)