feat: Update node label format to Name (Type) without outer parentheses
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package config
|
||||
|
||||
import "fmt"
|
||||
|
||||
// NodeType represents the type of network node
|
||||
type NodeType string
|
||||
|
||||
@@ -56,7 +58,7 @@ func (nm *NetworkMap) FindByIP(ip string) *NetworkNode {
|
||||
// LabelForIP returns a human-readable label for an IP, or the IP itself if unknown
|
||||
func (nm *NetworkMap) LabelForIP(ip string) string {
|
||||
if node := nm.FindByIP(ip); node != nil {
|
||||
return node.Name
|
||||
return fmt.Sprintf("%s (%s)", node.Name, node.Type)
|
||||
}
|
||||
return ip
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user