integrate widget order, toggling into global config and compact grid

This commit is contained in:
Bradley Cicenas
2020-01-02 14:00:55 +00:00
parent d34b9c2bf6
commit ee25f80a9c
10 changed files with 186 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
package config
// defaults
var params = []*Param{
var defaultParams = []*Param{
&Param{
Key: "filterStr",
Val: "",
@@ -27,6 +27,9 @@ type Param struct {
// Get Param by key
func Get(k string) *Param {
lock.RLock()
defer lock.RUnlock()
for _, p := range GlobalParams {
if p.Key == k {
return p
@@ -43,7 +46,10 @@ func GetVal(k string) string {
// Set param value
func Update(k, v string) {
p := Get(k)
log.Noticef("config change: %s: %s -> %s", k, quote(p.Val), quote(v))
log.Noticef("config change [%s]: %s -> %s", k, quote(p.Val), quote(v))
lock.Lock()
defer lock.Unlock()
p.Val = v
// log.Errorf("ignoring update for non-existant parameter: %s", k)
}