Skip to content

Commit

Permalink
Show both name and UUID for connector environment
Browse files Browse the repository at this point in the history
  • Loading branch information
janelletavares committed Dec 21, 2021
1 parent 49c96c4 commit bb85d29
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions utils/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,25 @@ func ConnectorTable(connector *meroxa.Connector) string {
{Text: connector.Trace},
})
}
var env string
if connector.Environment != nil && connector.Environment.Name != "" {
env = connector.Environment.Name
if connector.Environment != nil {
if envUUID := connector.Environment.UUID; envUUID != "" {
mainTable.Body.Cells = append(mainTable.Body.Cells, []*simpletable.Cell{
{Align: simpletable.AlignRight, Text: "Environment UUID:"},
{Text: envUUID},
})
}
if envName := connector.Environment.Name; envName != "" {
mainTable.Body.Cells = append(mainTable.Body.Cells, []*simpletable.Cell{
{Align: simpletable.AlignRight, Text: "Environment Name:"},
{Text: envName},
})
}
} else {
env = string(meroxa.EnvironmentTypeCommon)
mainTable.Body.Cells = append(mainTable.Body.Cells, []*simpletable.Cell{
{Align: simpletable.AlignRight, Text: "Environment Name:"},
{Text: string(meroxa.EnvironmentTypeCommon)},
})
}
mainTable.Body.Cells = append(mainTable.Body.Cells, []*simpletable.Cell{
{Align: simpletable.AlignRight, Text: "Environment:"},
{Text: env},
})

mainTable.SetStyle(simpletable.StyleCompact)

Expand Down

0 comments on commit bb85d29

Please sign in to comment.