Skip to content

Commit 8aa0a96

Browse files
committed
feat(machine ls): add ARCH, VERSION, DOCKER columns in the output table
1 parent 8b95db6 commit 8aa0a96

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

‎cmd/uncloud/machine/ls.go‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func list(ctx context.Context, uncli *cli.CLI) error {
4040

4141
// Print the list of machines in a table format.
4242
t := tui.NewTable()
43-
t.Headers("NAME", "STATE", "ADDRESS", "PUBLIC IP", "WIREGUARD ENDPOINTS", "MACHINE ID")
43+
t.Headers("NAME", "STATE", "ADDRESS", "PUBLIC IP", "WIREGUARD ENDPOINTS", "ARCH", "VERSION", "DOCKER", "MACHINE ID")
4444

4545
for _, member := range machines {
4646
m := member.Machine
@@ -59,12 +59,30 @@ func list(ctx context.Context, uncli *cli.CLI) error {
5959
endpoints[i] = addrPort.String()
6060
}
6161

62+
arch := "-"
63+
if m.Arch != "" {
64+
arch = m.Arch
65+
}
66+
67+
daemonVersion := "-"
68+
if m.DaemonVersion != "" {
69+
daemonVersion = m.DaemonVersion
70+
}
71+
72+
dockerVersion := "-"
73+
if m.DockerVersion != "" {
74+
dockerVersion = m.DockerVersion
75+
}
76+
6277
t.Row(
6378
m.Name,
6479
capitalise(member.State.String()),
6580
subnet.String(),
6681
publicIP,
6782
strings.Join(endpoints, tui.Faint.Render(", ")),
83+
arch,
84+
daemonVersion,
85+
dockerVersion,
6886
member.Machine.Id,
6987
)
7088
}

0 commit comments

Comments
 (0)