feat: Show 'Down' badge for not connected peers

Signed-off-by: Christoph Heiss <contact@christoph-heiss.at>
This commit is contained in:
Christoph Heiss 2022-06-22 20:09:23 +02:00
parent a9aa5be5c9
commit 8db4c219ab
Signed by: c8h4
GPG key ID: 9C82009BEEDEA0FF
2 changed files with 7 additions and 2 deletions

View file

@ -191,9 +191,9 @@ function parseAllowedIp(data: Buffer): string {
function parseWgPeer(peerinfo: NetlinkAttribute): WireguardPeer {
const result: WireguardPeer = {
publicKey: '<unknown>',
publicKey: '',
hasPresharedKey: false,
endpoint: '<unknown>',
endpoint: '',
keepAlive: 0,
lastHandshake: new Date(0).toISOString(),
rxBytes: 0,

View file

@ -148,6 +148,11 @@ export default function Index({ user }: IndexProps) {
<span className="chip ~neutral mr-2">
Peer
</span>
{!peer.endpoint && (
<span className="chip ~critical">
Down
</span>
)}
{peer.hasPresharedKey
? (
<span className="chip ~positive">