mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
export config struct fields, add convenience methods for value fetching
This commit is contained in:
4
sort.go
4
sort.go
@@ -27,8 +27,8 @@ type Containers []*Container
|
||||
func (a Containers) Len() int { return len(a) }
|
||||
func (a Containers) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a Containers) Less(i, j int) bool {
|
||||
f := Sorters[config.Get("sortField")]
|
||||
if config.GetSwitch("sortReversed") {
|
||||
f := Sorters[config.GetVal("sortField")]
|
||||
if config.GetSwitchVal("sortReversed") {
|
||||
return f(a[j], a[i])
|
||||
}
|
||||
return f(a[i], a[j])
|
||||
|
||||
Reference in New Issue
Block a user