mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat(machine ls): add ARCH, VERSION, DOCKER columns in the output table
This commit is contained in:
@@ -40,7 +40,7 @@ func list(ctx context.Context, uncli *cli.CLI) error {
|
||||
|
||||
// Print the list of machines in a table format.
|
||||
t := tui.NewTable()
|
||||
t.Headers("NAME", "STATE", "ADDRESS", "PUBLIC IP", "WIREGUARD ENDPOINTS", "MACHINE ID")
|
||||
t.Headers("NAME", "STATE", "ADDRESS", "PUBLIC IP", "WIREGUARD ENDPOINTS", "ARCH", "VERSION", "DOCKER", "MACHINE ID")
|
||||
|
||||
for _, member := range machines {
|
||||
m := member.Machine
|
||||
@@ -59,12 +59,30 @@ func list(ctx context.Context, uncli *cli.CLI) error {
|
||||
endpoints[i] = addrPort.String()
|
||||
}
|
||||
|
||||
arch := "-"
|
||||
if m.Arch != "" {
|
||||
arch = m.Arch
|
||||
}
|
||||
|
||||
daemonVersion := "-"
|
||||
if m.DaemonVersion != "" {
|
||||
daemonVersion = m.DaemonVersion
|
||||
}
|
||||
|
||||
dockerVersion := "-"
|
||||
if m.DockerVersion != "" {
|
||||
dockerVersion = m.DockerVersion
|
||||
}
|
||||
|
||||
t.Row(
|
||||
m.Name,
|
||||
capitalise(member.State.String()),
|
||||
subnet.String(),
|
||||
publicIP,
|
||||
strings.Join(endpoints, tui.Faint.Render(", ")),
|
||||
arch,
|
||||
daemonVersion,
|
||||
dockerVersion,
|
||||
member.Machine.Id,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user