Status page: display peers IPs only to admins

This commit is contained in:
0xCA 2024-01-06 18:46:49 +05:00
parent a22e807d2a
commit 3125a4390b

View file

@ -978,10 +978,13 @@ func Status(db store.IStore) echo.HandlerFunc {
LastHandshakeTime: devices[i].Peers[j].LastHandshakeTime,
LastHandshakeRel: time.Since(devices[i].Peers[j].LastHandshakeTime),
AllocatedIP: allocatedIPs,
Endpoint: devices[i].Peers[j].Endpoint.String(),
}
pVm.Connected = pVm.LastHandshakeRel.Minutes() < 3.
if isAdmin(c) {
pVm.Endpoint = devices[i].Peers[j].Endpoint.String()
}
if _client, ok := m[pVm.PublicKey]; ok {
pVm.Name = _client.Name
pVm.Email = _client.Email