summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-01 20:14:36 -0500
committerJeff Carr <[email protected]>2025-09-01 20:14:36 -0500
commit559e276c44962be9b14506e42326ff07fdafb579 (patch)
tree7a269a2855d0ee5a4de745c2a6c982cca9b203f8
parentf0cea5973d51ab9bd5bd4e80456b9f2357a37706 (diff)
more show tables
-rw-r--r--humanTable.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/humanTable.go b/humanTable.go
index 78a9b2e..29e6411 100644
--- a/humanTable.go
+++ b/humanTable.go
@@ -3,7 +3,11 @@
package chatpb
import (
+ "strings"
+ "time"
+
"go.wit.com/lib/cobol"
+ "go.wit.com/lib/gui/shell"
"go.wit.com/log"
)
@@ -73,23 +77,29 @@ func (c *Chat) PrintChatGeminiTable() {
log.DaemonMode(true)
// print the header
- args := []string{"uuid", "age", "con file", "Who", "model", "", "", "", "", ""}
- sizes := []int{40, 16, 8, 4, 8, 2, 2, 2, 2, 2}
+ args := []string{"uuid", "age", "ID", "Who", "model", "", "", "", "", ""}
+ sizes := []int{40, 5, 5, 8, 12, 2, 2, 2, 2, 2}
log.Info(cobol.StandardTableSize10(sizes, args))
for _, e := range c.GetEntries() {
var args []string
- age := e.Ctime.AsTime().String()
+ dur := time.Since(e.Ctime.AsTime())
+ age := shell.FormatDuration(dur)
var model string
+ var id string
if e.GeminiRequest == nil {
model = "nil"
} else {
model = e.GeminiRequest.Model
}
- args = []string{e.Uuid, age, e.GetContentFile(), e.From.String(), model, "", "", "", "", ""}
+ if e.GetContentFile() != "" {
+ parts := strings.Split(e.GetContentFile(), ".")
+ id = parts[3]
+ }
+ args = []string{e.Uuid, age, id, e.From.String(), model, "", "", "", "", ""}
start := cobol.StandardTableSize10(sizes, args)
- log.Info(start)
+ log.Info(start, e.GetContentFile())
}
log.Infof("Total Chats: %d\n", len(c.GetEntries()))
}