mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-05 06:04:35 +08:00
fix: Fix image sorting anomalies
This commit is contained in:
parent
6f45b90520
commit
72febca669
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
|
||||
})
|
||||
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":
|
||||
sort.Slice(records, func(i, j int) bool {
|
||||
if len(records[i].Tags) == 0 || len(records[j].Tags) == 0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue