update worked to gocui
This commit is contained in:
parent
c6cb62c86d
commit
4aef241137
|
@ -49,7 +49,18 @@ func (mt *DropletsTable) Update() {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
mt.parent.ShowTable(mt.pb)
|
mt.dumpStringFunc("Hostname")
|
||||||
|
mt.parent.UpdateTable(mt.pb)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mt *DropletsTable) dumpStringFunc(name string) {
|
||||||
|
for i, r := range mt.pb.StringRows {
|
||||||
|
// log.Info("could use", i, r.Header.Name, "for name =", name)
|
||||||
|
if r.Header.Name == name {
|
||||||
|
log.Info("dump Strings row", i, r.Header.Name, r.Vals)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mt *DropletsTable) updateStringFunc(name string) bool {
|
func (mt *DropletsTable) updateStringFunc(name string) bool {
|
||||||
|
@ -71,10 +82,15 @@ func (mt *DropletsTable) updateStringFunc(name string) bool {
|
||||||
if sf.title != name {
|
if sf.title != name {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Info("updateStringFunc() has row len =", len(mt.x.Droplets))
|
log.Printf("updateStringFunc() %s len (%d)\n", name, len(mt.x.Droplets))
|
||||||
log.Info("virtpb: starting", name, found.Vals)
|
log.Info("virtpb: starting", name, found.Vals)
|
||||||
for i, _ := range found.Vals {
|
for i, _ := range found.Vals {
|
||||||
found.Vals[i] = sf.f(mt.x.Droplets[i])
|
tmp := sf.f(mt.x.Droplets[i])
|
||||||
|
if tmp == "www.wit.com" {
|
||||||
|
log.Info("virtpb: FOUND WWW", i)
|
||||||
|
tmp = "new.www"
|
||||||
|
}
|
||||||
|
found.Vals[i] = tmp
|
||||||
}
|
}
|
||||||
log.Info("virtpb: ending", name, found.Vals)
|
log.Info("virtpb: ending", name, found.Vals)
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue