forked from coop-cloud/abra
fix: more meta for listing recipes
This commit is contained in:
parent
d66c558b5c
commit
c0caf14d74
|
@ -3,6 +3,7 @@ package recipe
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"coopcloud.tech/abra/cli/formatter"
|
"coopcloud.tech/abra/cli/formatter"
|
||||||
"coopcloud.tech/abra/pkg/catalogue"
|
"coopcloud.tech/abra/pkg/catalogue"
|
||||||
|
@ -23,15 +24,23 @@ var recipeListCommand = &cli.Command{
|
||||||
recipes := catl.Flatten()
|
recipes := catl.Flatten()
|
||||||
sort.Sort(catalogue.ByRecipeName(recipes))
|
sort.Sort(catalogue.ByRecipeName(recipes))
|
||||||
|
|
||||||
tableCol := []string{"name", "category", "status"}
|
tableCol := []string{"name", "category", "status", "healthcheck", "backups", "email", "SSO"}
|
||||||
table := formatter.CreateTable(tableCol)
|
table := formatter.CreateTable(tableCol)
|
||||||
|
|
||||||
for _, recipe := range recipes {
|
for _, recipe := range recipes {
|
||||||
status := fmt.Sprintf("%v", recipe.Features.Status)
|
tableRow := []string{
|
||||||
tableRow := []string{recipe.Name, recipe.Category, status}
|
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.Append(tableRow)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.SetCaption(true, fmt.Sprintf("total recipes: %v", len(recipes)))
|
||||||
table.Render()
|
table.Render()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue