Skip to content
Merged
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
11 changes: 11 additions & 0 deletions internal/tiger/cmd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ type OutputService struct {
api.Service
password.ConnectionDetails
ConnectionString string `json:"connection_string,omitempty" yaml:"connection_string,omitempty"`
ConsoleURL string `json:"console_url,omitempty" yaml:"console_url,omitempty"`
}

// Convert to JSON to respect omitempty tags, then unmarshal
Expand Down Expand Up @@ -769,6 +770,9 @@ func outputServiceTable(service OutputService, output io.Writer) error {
if service.ConnectionString != "" {
table.Append("Connection String", service.ConnectionString)
}
if service.ConsoleURL != "" {
table.Append("Console URL", service.ConsoleURL)
}

return table.Render()
}
Expand Down Expand Up @@ -821,6 +825,13 @@ func prepareServiceForOutput(service api.Service, withPassword bool, output io.W
outputSvc.ConnectionString = connectionDetails.String()
}

// Build console URL
cfg, err := config.Load()
if err == nil {
url := fmt.Sprintf("%s/dashboard/services/%s", cfg.ConsoleURL, *service.ServiceId)
outputSvc.ConsoleURL = url
}

return outputSvc
}

Expand Down