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

@@ -59,7 +59,7 @@ func IndexTemplateList(conf *cfg.Config, filter string) error {
slog.Debug("res", "index templates", res)
table := printer.NewTable(conf, 5, 0)
table := printer.NewTable(conf).WithSize(5, 0)
table.Addheaders("name", "description", "index patterns", "priority")
tplList := filterIndexTemplates(conf, filter, res.IndexTemplates)
@@ -120,7 +120,7 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
tpl := res.IndexTemplates[0]
table := printer.NewTable(conf, 2, 6)
table := printer.NewTable(conf).WithSize(2, 6)
table.Addheaders("index template property", "value")
desc, err := json.Marshal(tpl.IndexTemplate.Meta_["description"])
@@ -148,7 +148,7 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
return err
}
table = printer.NewTable(conf, 2, 0)
table = printer.NewTable(conf).WithSize(2, 0)
table.Addheaders("index setting property", "value")
err = getIndexTemplateSettings(conf, tplname, table)
@@ -162,7 +162,7 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
return err
}
table = printer.NewTable(conf, 2, 0)
table = printer.NewTable(conf).WithSize(2, 0)
table.Addheaders("index field mapping", "type")
if tpl.IndexTemplate.Template.Mappings != nil {
@@ -441,7 +441,7 @@ func rolloverAliasIndexTemplate(conf *cfg.Config, name string) error {
return nil
}
table := printer.NewTable(conf, 4, 0)
table := printer.NewTable(conf).WithSize(4, 0)
table.Addheaders("rollover alias", "status", "ack", "new index")
// apply rollover to all matching aliases, if any