From 04ec266d841320f9492a6ad18ccc511b2826ec82 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Wed, 31 Jan 2024 13:17:53 +0100 Subject: [PATCH] Show firewall and machine state in machine list (#282) --- cmd/output/machine.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/output/machine.go b/cmd/output/machine.go index 37586cfb..6dd8c0ce 100644 --- a/cmd/output/machine.go +++ b/cmd/output/machine.go @@ -21,6 +21,8 @@ const ( skull = "\U0001F480" question = "\U00002753" circle = "●" + VPN = "🛡" + Lock = "🔒" ) // Print a list of Machines in a table @@ -94,6 +96,15 @@ func (m MachineTablePrinter) Print(data []*models.ModelsV1MachineResponse) { default: statusEmoji = question } + + if machine.State != nil && machine.State.Value != nil && *machine.State.Value == "LOCK" { + statusEmoji = Lock + } + + if machine.Allocation != nil && machine.Allocation.Vpn != nil { + statusEmoji = VPN + } + row := []string{machineID, statusEmoji, lastEvent, when, started, age, hostname, ips, sizeID, image, partitionID} m.addShortData(row, machine) m.addWideData(row, machine)