Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show template a flow was created with #170

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kardinal-cli/cmd/table_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ func printTemplateTable(templates []api_types.Template) {
// Update the existing printFlowTable function to use the new generic function
func printFlowTable(flows []api_types.Flow) {
data := lo.Map(flows, func(flow api_types.Flow, _ int) []string {
templateName := "default"
if flow.TemplateName != nil {
templateName = *flow.TemplateName
}
return []string{
flow.FlowId,
strings.Join(lo.Map(flow.FlowUrls, func(item string, _ int) string { return fmt.Sprintf("http://%s", item) }), ", "),
templateName,
}
})

header := []string{"Flow ID", "Flow URL"}
header := []string{"Flow ID", "Flow URL", "Template"}
printGenericTable(header, data)
}

Expand Down
48 changes: 24 additions & 24 deletions libs/cli-kontrol-api/api/golang/server/server.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions libs/cli-kontrol-api/api/golang/types/types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions libs/cli-kontrol-api/api/typescript/client/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export interface components {
Flow: {
"flow-id": string;
"flow-urls": string[];
"template-name"?: string;
};
FlowSpec: {
/** @example backend-a:latest */
Expand Down
2 changes: 2 additions & 0 deletions libs/cli-kontrol-api/specs/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ components:
type: array
items:
type: string
template-name:
type: string
required:
- flow-id
- flow-urls
Expand Down
Loading