more show tables
This commit is contained in:
parent
f0cea5973d
commit
559e276c44
|
@ -3,7 +3,11 @@
|
||||||
package chatpb
|
package chatpb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"go.wit.com/lib/cobol"
|
"go.wit.com/lib/cobol"
|
||||||
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -73,23 +77,29 @@ func (c *Chat) PrintChatGeminiTable() {
|
||||||
log.DaemonMode(true)
|
log.DaemonMode(true)
|
||||||
|
|
||||||
// print the header
|
// print the header
|
||||||
args := []string{"uuid", "age", "con file", "Who", "model", "", "", "", "", ""}
|
args := []string{"uuid", "age", "ID", "Who", "model", "", "", "", "", ""}
|
||||||
sizes := []int{40, 16, 8, 4, 8, 2, 2, 2, 2, 2}
|
sizes := []int{40, 5, 5, 8, 12, 2, 2, 2, 2, 2}
|
||||||
log.Info(cobol.StandardTableSize10(sizes, args))
|
log.Info(cobol.StandardTableSize10(sizes, args))
|
||||||
|
|
||||||
for _, e := range c.GetEntries() {
|
for _, e := range c.GetEntries() {
|
||||||
var args []string
|
var args []string
|
||||||
age := e.Ctime.AsTime().String()
|
dur := time.Since(e.Ctime.AsTime())
|
||||||
|
age := shell.FormatDuration(dur)
|
||||||
var model string
|
var model string
|
||||||
|
var id string
|
||||||
if e.GeminiRequest == nil {
|
if e.GeminiRequest == nil {
|
||||||
model = "nil"
|
model = "nil"
|
||||||
} else {
|
} else {
|
||||||
model = e.GeminiRequest.Model
|
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)
|
start := cobol.StandardTableSize10(sizes, args)
|
||||||
log.Info(start)
|
log.Info(start, e.GetContentFile())
|
||||||
}
|
}
|
||||||
log.Infof("Total Chats: %d\n", len(c.GetEntries()))
|
log.Infof("Total Chats: %d\n", len(c.GetEntries()))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue