mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Add FriendlyName option, show friendly name and real endpoint in admin socket/yggdrasilctl
This commit is contained in:
parent
a9f72a6ee1
commit
b809adf981
7 changed files with 67 additions and 40 deletions
|
@ -470,6 +470,7 @@ func (a *admin) getData_getSelf() *admin_nodeInfo {
|
|||
{"ip", a.core.GetAddress().String()},
|
||||
{"subnet", a.core.GetSubnet().String()},
|
||||
{"coords", fmt.Sprint(coords)},
|
||||
{"friendly_name", a.core.friendlyName},
|
||||
}
|
||||
return &self
|
||||
}
|
||||
|
@ -492,6 +493,8 @@ func (a *admin) getData_getPeers() []admin_nodeInfo {
|
|||
{"uptime", int(time.Since(p.firstSeen).Seconds())},
|
||||
{"bytes_sent", atomic.LoadUint64(&p.bytesSent)},
|
||||
{"bytes_recvd", atomic.LoadUint64(&p.bytesRecvd)},
|
||||
{"endpoint", p.endpoint},
|
||||
{"friendly_name", p.friendlyName},
|
||||
}
|
||||
peerInfos = append(peerInfos, info)
|
||||
}
|
||||
|
@ -516,6 +519,8 @@ func (a *admin) getData_getSwitchPeers() []admin_nodeInfo {
|
|||
{"port", elem.port},
|
||||
{"bytes_sent", atomic.LoadUint64(&peer.bytesSent)},
|
||||
{"bytes_recvd", atomic.LoadUint64(&peer.bytesRecvd)},
|
||||
{"endpoint", peer.endpoint},
|
||||
{"friendly_name", peer.friendlyName},
|
||||
}
|
||||
peerInfos = append(peerInfos, info)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue