feat: Update node label format to Name (Type) without outer parentheses

This commit is contained in:
Jose Luis Montañes Ojados
2026-01-19 14:52:38 +01:00
parent 2a8f0c633a
commit 5f00506758
3 changed files with 4 additions and 2 deletions

Binary file not shown.

View File

@@ -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
}

View File

@@ -793,7 +793,7 @@ func (m Model) renderCallDetail() string {
node := m.networkMap.FindByIP(mediaIP)
label = m.styleForNode(node).Render(label)
}
b.WriteString(fmt.Sprintf(" SDP Media: %s (%s)\n", mediaIP, label))
b.WriteString(fmt.Sprintf(" SDP Media: %s %s\n", mediaIP, label))
}
}
}