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:
Andy Oknen 2025-08-15 14:25:58 +00:00
parent 1ca92725af
commit 8ee5c9fbe1
4 changed files with 73 additions and 2 deletions

View file

@ -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(),