summaryrefslogtreecommitdiff
path: root/windowEvents.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-10 07:08:28 -0500
committerJeff Carr <[email protected]>2025-03-10 07:59:25 -0500
commit18c1221efc1a4e6b97afb5547d44055a29150dff (patch)
tree0b449cd41ec8044e90a0286ab76437a73088e40d /windowEvents.go
parent22d07987494113dc85542b753c3ecc7e9db37511 (diff)
show last 20 events works
Diffstat (limited to 'windowEvents.go')
-rw-r--r--windowEvents.go43
1 files changed, 35 insertions, 8 deletions
diff --git a/windowEvents.go b/windowEvents.go
index 20a102d..6a93188 100644
--- a/windowEvents.go
+++ b/windowEvents.go
@@ -11,24 +11,51 @@ import (
func makeEventsWin() {
me.eventswin = new(stdEventTableWin)
- me.eventswin.win = gadgets.NewGenericWindow("zood daemon versions", "todo: add global controls here")
+ me.eventswin.win = gadgets.NewGenericWindow("Gus current event log", "who is squirreling around?")
me.eventswin.win.Custom = func() {
log.Info("test delete window here")
}
grid := me.eventswin.win.Group.RawGrid()
- grid.NewButton("ConfigSave() ", func() {
- saveMachineState()
+
+ grid.NewButton("first 20", func() {
+ var count int
+ found := NewEvents()
+ all := me.events.All()
+ for all.Scan() {
+ e := all.Next()
+ count += 1
+ found.Append(e)
+ if count > 20 {
+ break
+ }
+ }
+ doEventsTable(found)
})
- grid.NewButton("Add() ", func() {
+
+ grid.NewButton("last 20", func() {
+ var count int
+ total := me.events.Len()
+ found := NewEvents()
+ all := me.events.All()
+ for all.Scan() {
+ e := all.Next()
+ count += 1
+ if count < total-20 {
+ continue
+ }
+ found.Append(e)
+ }
+ doEventsTable(found)
})
- grid.NewCheckbox("hide active")
- grid.NewButton("update", func() {
- doMachinesUpgradeTable()
+
+ grid.NewButton("Save Current", func() {
+ log.Info("event log is len =", me.events.Len())
+ me.events.Save()
})
// make a box at the bottom of the window for the protobuf table
me.eventswin.box = me.eventswin.win.Bottom.Box().SetProgName("TBOX")
- doEventsTable(me.events)
+ // doEventsTable(me.events)
}
func doEventsTable(currentEvents *Events) {