ls consistency: make tctl apps ls output consistent

```
Host Name        Public Address       URI                 Labels                          Version
---- ----------- -------------------- ------------------- ------------------------------- -------------
corn example-app example-app.corn.lan http://0.0.0.0:8000 teleport.dev/origin=config-file 8.0.0-alpha.1
```
This commit is contained in:
Alex McGrath 2021-12-16 15:27:00 +00:00 committed by Alex McGrath
parent 23731673d9
commit cff5165ad3

View file

@ -459,11 +459,11 @@ func (a *appServerCollection) resources() (r []types.Resource) {
}
func (a *appServerCollection) writeText(w io.Writer) error {
t := asciitable.MakeTable([]string{"Application", "Host", "Public Address", "URI", "Labels"})
t := asciitable.MakeTable([]string{"Host", "Name", "Public Address", "URI", "Labels", "Version"})
for _, server := range a.servers {
app := server.GetApp()
t.AddRow([]string{
app.GetName(), server.GetHostname(), app.GetPublicAddr(), app.GetURI(), app.LabelsString(),
server.GetHostname(), app.GetName(), app.GetPublicAddr(), app.GetURI(), app.LabelsString(), server.GetTeleportVersion(),
})
}
_, err := t.AsBuffer().WriteTo(w)