mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-11 00:54:55 +08:00
fix: Fix image sorting anomalies (#10159)
This commit is contained in:
parent
c0a0f4c801
commit
8663ed129d
1 changed files with 7 additions and 0 deletions
|
@ -102,6 +102,13 @@ func (u *ImageService) Page(req dto.PageImage) (int64, interface{}, error) {
|
||||||
}
|
}
|
||||||
return records[i].Size > records[j].Size
|
return records[i].Size > records[j].Size
|
||||||
})
|
})
|
||||||
|
case "isUsed":
|
||||||
|
sort.Slice(records, func(i, j int) bool {
|
||||||
|
if req.Order == constant.OrderAsc {
|
||||||
|
return !records[i].IsUsed
|
||||||
|
}
|
||||||
|
return records[i].IsUsed
|
||||||
|
})
|
||||||
case "tags":
|
case "tags":
|
||||||
sort.Slice(records, func(i, j int) bool {
|
sort.Slice(records, func(i, j int) bool {
|
||||||
if len(records[i].Tags) == 0 || len(records[j].Tags) == 0 {
|
if len(records[i].Tags) == 0 || len(records[j].Tags) == 0 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue