fix: more meta for listing recipes

This commit is contained in:
decentral1se 2021-12-25 17:17:41 +01:00
parent d66c558b5c
commit c0caf14d74
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 12 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package recipe
import (
"fmt"
"sort"
"strconv"
"coopcloud.tech/abra/cli/formatter"
"coopcloud.tech/abra/pkg/catalogue"
@ -23,15 +24,23 @@ var recipeListCommand = &cli.Command{
recipes := catl.Flatten()
sort.Sort(catalogue.ByRecipeName(recipes))
tableCol := []string{"name", "category", "status"}
tableCol := []string{"name", "category", "status", "healthcheck", "backups", "email", "SSO"}
table := formatter.CreateTable(tableCol)
for _, recipe := range recipes {
status := fmt.Sprintf("%v", recipe.Features.Status)
tableRow := []string{recipe.Name, recipe.Category, status}
tableRow := []string{
recipe.Name,
recipe.Category,
strconv.Itoa(recipe.Features.Status),
recipe.Features.Healthcheck,
recipe.Features.Backups,
recipe.Features.Email,
recipe.Features.SSO,
}
table.Append(tableRow)
}
table.SetCaption(true, fmt.Sprintf("total recipes: %v", len(recipes)))
table.Render()
return nil