mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-08-25 16:35:07 +03:00
Enhance peer display by including peer names alongside IP addresses in the WebUI and CLI. Update peer data retrieval to fetch names from node information.
This commit is contained in:
parent
1ca92725af
commit
8ee5c9fbe1
4 changed files with 73 additions and 2 deletions
|
@ -208,11 +208,18 @@ func run() int {
|
|||
if peer.TXRate > 0 {
|
||||
txr = peer.TXRate.String() + "/s"
|
||||
}
|
||||
|
||||
// Format IP address with name if available
|
||||
ipDisplay := peer.IPAddress
|
||||
if peer.Name != "" {
|
||||
ipDisplay = fmt.Sprintf("%s (%s)", peer.Name, peer.IPAddress)
|
||||
}
|
||||
|
||||
table.Append([]string{
|
||||
uristring,
|
||||
state,
|
||||
dir,
|
||||
peer.IPAddress,
|
||||
ipDisplay,
|
||||
(time.Duration(peer.Uptime) * time.Second).String(),
|
||||
rtt,
|
||||
peer.RXBytes.String(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue