mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-26 08:53:05 +00:00
nodes list: expose expiration time
This commit is contained in:
parent
dd173ecc1f
commit
e27e01c09f
1 changed files with 6 additions and 0 deletions
|
@ -475,6 +475,7 @@ func nodesToPtables(
|
||||||
"IP addresses",
|
"IP addresses",
|
||||||
"Ephemeral",
|
"Ephemeral",
|
||||||
"Last seen",
|
"Last seen",
|
||||||
|
"Expiration",
|
||||||
"Online",
|
"Online",
|
||||||
"Expired",
|
"Expired",
|
||||||
}
|
}
|
||||||
|
@ -501,8 +502,12 @@ func nodesToPtables(
|
||||||
}
|
}
|
||||||
|
|
||||||
var expiry time.Time
|
var expiry time.Time
|
||||||
|
var expiryTime string
|
||||||
if machine.Expiry != nil {
|
if machine.Expiry != nil {
|
||||||
expiry = machine.Expiry.AsTime()
|
expiry = machine.Expiry.AsTime()
|
||||||
|
expiryTime = expiry.Format("2006-01-02 15:04:05")
|
||||||
|
} else {
|
||||||
|
expiryTime = "N/A"
|
||||||
}
|
}
|
||||||
|
|
||||||
var machineKey key.MachinePublic
|
var machineKey key.MachinePublic
|
||||||
|
@ -583,6 +588,7 @@ func nodesToPtables(
|
||||||
strings.Join([]string{IPV4Address, IPV6Address}, ", "),
|
strings.Join([]string{IPV4Address, IPV6Address}, ", "),
|
||||||
strconv.FormatBool(ephemeral),
|
strconv.FormatBool(ephemeral),
|
||||||
lastSeenTime,
|
lastSeenTime,
|
||||||
|
expiryTime,
|
||||||
online,
|
online,
|
||||||
expired,
|
expired,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue