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.
|
// Print the list of machines in a table format.
|
||||||
t := tui.NewTable()
|
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 {
|
for _, member := range machines {
|
||||||
m := member.Machine
|
m := member.Machine
|
||||||
@@ -59,12 +59,30 @@ func list(ctx context.Context, uncli *cli.CLI) error {
|
|||||||
endpoints[i] = addrPort.String()
|
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(
|
t.Row(
|
||||||
m.Name,
|
m.Name,
|
||||||
capitalise(member.State.String()),
|
capitalise(member.State.String()),
|
||||||
subnet.String(),
|
subnet.String(),
|
||||||
publicIP,
|
publicIP,
|
||||||
strings.Join(endpoints, tui.Faint.Render(", ")),
|
strings.Join(endpoints, tui.Faint.Render(", ")),
|
||||||
|
arch,
|
||||||
|
daemonVersion,
|
||||||
|
dockerVersion,
|
||||||
member.Machine.Id,
|
member.Machine.Id,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user