Skip to content

Commit

Permalink
chore: sort kubes in cache view
Browse files Browse the repository at this point in the history
  • Loading branch information
djpiper28 committed Mar 15, 2024
1 parent a254410 commit e7399a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kube_cache/server/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package server
import (
"fmt"
"log"
"sort"

"github.com/CosmicKube/kube_cache/model"
"github.com/gin-gonic/gin"
Expand Down Expand Up @@ -62,6 +63,10 @@ func (s *Server) Index(c *gin.Context) {
return
}

sort.Slice(kubes, func(i, j int) bool {
return kubes[i].Name < kubes[j].Name
})

kubesHtml := ""
for _, kube := range kubes {
kubesHtml += fmt.Sprintf(`<div style="max-width: 100px;">
Expand Down

0 comments on commit e7399a9

Please sign in to comment.