Merge 'dev' into 'master' #2
11
daemon.go
11
daemon.go
@@ -7,6 +7,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"slices"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
@@ -357,6 +358,16 @@ func (ds *DaemonServer) handleList(w http.ResponseWriter, r *http.Request) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
slices.SortFunc(responseList, func(a, b InstanceStatusResponse) int {
|
||||||
|
if a.Name < b.Name {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
if a.Name > b.Name {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
})
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
json.NewEncoder(w).Encode(responseList)
|
json.NewEncoder(w).Encode(responseList)
|
||||||
|
|||||||
Reference in New Issue
Block a user