mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-18 19:49:30 +03:00
Status page: display peers IPs only to admins (#521)
This commit is contained in:
parent
84032d1e06
commit
7856ce9555
1 changed files with 4 additions and 1 deletions
|
@ -979,10 +979,13 @@ func Status(db store.IStore) echo.HandlerFunc {
|
||||||
LastHandshakeTime: devices[i].Peers[j].LastHandshakeTime,
|
LastHandshakeTime: devices[i].Peers[j].LastHandshakeTime,
|
||||||
LastHandshakeRel: time.Since(devices[i].Peers[j].LastHandshakeTime),
|
LastHandshakeRel: time.Since(devices[i].Peers[j].LastHandshakeTime),
|
||||||
AllocatedIP: allocatedIPs,
|
AllocatedIP: allocatedIPs,
|
||||||
Endpoint: devices[i].Peers[j].Endpoint.String(),
|
|
||||||
}
|
}
|
||||||
pVm.Connected = pVm.LastHandshakeRel.Minutes() < 3.
|
pVm.Connected = pVm.LastHandshakeRel.Minutes() < 3.
|
||||||
|
|
||||||
|
if isAdmin(c) {
|
||||||
|
pVm.Endpoint = devices[i].Peers[j].Endpoint.String()
|
||||||
|
}
|
||||||
|
|
||||||
if _client, ok := m[pVm.PublicKey]; ok {
|
if _client, ok := m[pVm.PublicKey]; ok {
|
||||||
pVm.Name = _client.Name
|
pVm.Name = _client.Name
|
||||||
pVm.Email = _client.Email
|
pVm.Email = _client.Email
|
||||||
|
|
Loading…
Add table
Reference in a new issue