summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-20 03:14:57 -0600
committerJeff Carr <[email protected]>2025-02-20 03:23:14 -0600
commitf41728a81b2dec47cb826fab2acdaf2b9829f2f7 (patch)
treed2e0073bad4f5e1ed7b56cd58fac3aaf899b17b8
parenta32366631e455a6fa5b3436017decff1f4905392 (diff)
time columnv0.22.28
-rw-r--r--table.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/table.go b/table.go
index 5b4fb43..ee2eb94 100644
--- a/table.go
+++ b/table.go
@@ -9,6 +9,7 @@ import (
"go.wit.com/lib/protobuf/guipb"
"go.wit.com/log"
"go.wit.com/widget"
+ "google.golang.org/protobuf/types/known/anypb"
)
// should this be a gadget or in here with the widget primatives?
@@ -109,6 +110,7 @@ func makeTableWidgets(pb *guipb.Table) {
grid := addNode()
pb.Grid = new(guipb.Widget)
pb.Grid.Id = int64(grid.id)
+ pb.Grid.Name = "gridtablePB"
/*
// get unique widget ID numbers for the headers
@@ -128,7 +130,7 @@ func makeTableWidgets(pb *guipb.Table) {
pbwidget.Id = int64(label.id)
pbwidget.Name = v
r.Widgets = append(r.Widgets, pbwidget)
- log.Info("gui: added new WidgetS", pbwidget)
+ log.Info("gui: added new string", pbwidget)
}
}
@@ -145,4 +147,23 @@ func makeTableWidgets(pb *guipb.Table) {
log.Info("gui: added new int", pbwidget)
}
}
+
+ for i, r := range pb.TimeRows {
+ log.Info("gui: got time row:", i, r.Header, r.Vals)
+ header := addNode()
+ r.Header.Id = int64(header.id)
+ for _, v := range r.Vals {
+ label := addNode()
+ pbwidget := new(guipb.Widget)
+ pbwidget.Id = int64(label.id)
+ anyValue, err := anypb.New(v)
+ if err != nil {
+ log.Info("gui: failed to add time", err)
+ continue
+ }
+ pbwidget.Val = anyValue
+ r.Widgets = append(r.Widgets, pbwidget)
+ log.Info("gui: added new val", pbwidget)
+ }
+ }
}