Skip to content

Commit

Permalink
Hide last connection update time if it's zero
Browse files Browse the repository at this point in the history
  • Loading branch information
lixmal committed Jan 18, 2024
1 parent 230145b commit 14625d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ func parsePeers(peers peersStateOutput) string {
if peerState.IceCandidateEndpoint.Remote != "" {
remoteICEEndpoint = peerState.IceCandidateEndpoint.Remote
}
lastStatusUpdate := "-"
if !peerState.LastStatusUpdate.IsZero() {
lastStatusUpdate = peerState.LastStatusUpdate.Format("2006-01-02 15:04:05")
}

lastWireguardHandshake := "-"
if !peerState.LastWireguardHandshake.IsZero() {
Expand Down Expand Up @@ -542,7 +546,7 @@ func parsePeers(peers peersStateOutput) string {
remoteICE,
localICEEndpoint,
remoteICEEndpoint,
peerState.LastStatusUpdate.Format("2006-01-02 15:04:05"),
lastStatusUpdate,
lastWireguardHandshake,
toIEC(peerState.TransferReceived),
toIEC(peerState.TransferSent),
Expand Down

0 comments on commit 14625d0

Please sign in to comment.