sorting+modal fix
Deploy / deploy (push) Successful in 8s

This commit is contained in:
2026-08-31 23:09:35 +05:00
parent 28702bd029
commit b714c00b27
2 changed files with 30 additions and 6 deletions
+15 -1
View File
@@ -30,7 +30,21 @@ func (s *server) services(ctx context.Context) []*homelabv1.Service {
if s.mockSvcs != nil {
return s.mockSvcs
}
return append(s.systemdServices(ctx), s.dockerServices(ctx)...)
svcs := append(s.systemdServices(ctx), s.dockerServices(ctx)...)
// живые (active/partial) наверх, остальное (inactive, not-found, failed, error) вниз; внутри групп — по имени
rank := func(svc *homelabv1.Service) int {
if svc.Error == "" && (svc.State == "active" || svc.State == "partial") {
return 0
}
return 1
}
sort.SliceStable(svcs, func(i, j int) bool {
if ri, rj := rank(svcs[i]), rank(svcs[j]); ri != rj {
return ri < rj
}
return svcs[i].Name < svcs[j].Name
})
return svcs
}
// logProbeChange logs poll-path probe failures once per change: the poll repeats every 3s per client,