add reverse sort order option, toggle

This commit is contained in:
Bradley Cicenas
2017-01-12 14:48:29 -05:00
parent 6856a7028b
commit 9a87c269aa
4 changed files with 20 additions and 3 deletions
+10
View File
@@ -18,6 +18,15 @@ func updateConfig(k, v string) {
configChan <- ConfigMsg{k, v}
}
// Toggle a boolean option
func (c Config) toggle(k string) {
if c[k] == "0" {
c[k] = "1"
} else {
c[k] = "0"
}
}
func NewDefaultConfig() Config {
docker := os.Getenv("DOCKER_HOST")
if docker == "" {
@@ -26,6 +35,7 @@ func NewDefaultConfig() Config {
config := Config{
"dockerHost": docker,
"sortField": "id",
"sortReverse": "0",
"enableHeader": "0",
}
go func() {