more show tables

This commit is contained in:
Jeff Carr 2025-09-01 20:14:36 -05:00
parent f0cea5973d
commit 559e276c44
1 changed files with 15 additions and 5 deletions

View File

@ -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()))
}