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
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user