Show online in CLI & API when isOnline() reports so

This commit is contained in:
Juan Font 2022-12-13 22:29:50 +00:00 committed by Kristoffer Dalby
parent 4532915be1
commit 000c02dad9
2 changed files with 2 additions and 3 deletions

View file

@ -513,9 +513,7 @@ func nodesToPtables(
}
var online string
if lastSeen.After(
time.Now().Add(-5 * time.Minute),
) { // TODO: Find a better way to reliably show if online
if machine.Online {
online = pterm.LightGreen("online")
} else {
online = pterm.LightRed("offline")