mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-19 19:59:13 +03:00
Status page: display peers IPs only to admins
This commit is contained in:
parent
a22e807d2a
commit
3125a4390b
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue