streamline table api

This commit is contained in:
2026-08-07 22:59:33 +02:00
parent 59331fc721
commit ce5d7f51c6
25 changed files with 73 additions and 74 deletions

View File

@@ -37,7 +37,7 @@ func NodeList(conf *cfg.Config) error {
slog.Debug("ES result", "nodes", nodes)
table := printer.NewTableEmpty(conf).WithHeaders(
table := printer.NewTable(conf).WithHeaders(
"name", "ip", "load1m", "load5m", "load15m", "ram %", "heap %")
for _, node := range nodes {
@@ -104,7 +104,7 @@ func NodeShow(conf *cfg.Config, nodename string) error {
for id, info := range res.Nodes {
stat := stats.Nodes[id]
table := printer.NewTable(conf, 2, 0)
table := printer.NewTable(conf).WithSize(2, 0)
table.Addheaders(nodename+" property", "value")
roles := make([]string, len(info.Roles))
@@ -197,7 +197,7 @@ func NodeClients(conf *cfg.Config, nodename string) error {
slog.Debug("ES result", "stat", stats)
table := printer.NewTable(conf, 5, 0)
table := printer.NewTable(conf).WithSize(5, 0)
table.Addheaders("agent", "id", "when", "from host", "url")
for _, stat := range stats.Nodes {
@@ -250,7 +250,7 @@ func NodeUsage(conf *cfg.Config, nodeid string) error {
slog.Debug("ES result", "usage", stats)
table := printer.NewTableEmpty(conf).WithHeaders(
table := printer.NewTable(conf).WithHeaders(
"node",
"bulk",
"doc get",