feat: Refine Call Detail UI to separate network info from transaction flow
This commit is contained in:
@@ -629,20 +629,32 @@ func (m Model) renderCallDetail() string {
|
||||
b.WriteString(fmt.Sprintf("State: %s\n", flow.State))
|
||||
b.WriteString(fmt.Sprintf("Packets: %d\n\n", len(flow.Packets)))
|
||||
|
||||
// Network Summary Section
|
||||
b.WriteString("Network Layer:\n")
|
||||
// Find first packet to get initial IPs
|
||||
if len(flow.Packets) > 0 {
|
||||
first := flow.Packets[0]
|
||||
srcLabel := m.networkMap.LabelForIP(first.SourceIP)
|
||||
dstLabel := m.networkMap.LabelForIP(first.DestIP)
|
||||
|
||||
b.WriteString(fmt.Sprintf(" Source: %s (%s:%d)\n", srcLabel, first.SourceIP, first.SourcePort))
|
||||
b.WriteString(fmt.Sprintf(" Destination: %s (%s:%d)\n", dstLabel, first.DestIP, first.DestPort))
|
||||
}
|
||||
b.WriteString("\n")
|
||||
|
||||
b.WriteString("Transaction Flow:\n")
|
||||
for i, pkt := range flow.Packets {
|
||||
arrow := "→"
|
||||
if !pkt.IsRequest {
|
||||
// Simple direction indicator based on whether it matches initial source
|
||||
if len(flow.Packets) > 0 && pkt.SourceIP != flow.Packets[0].SourceIP {
|
||||
arrow = "←"
|
||||
}
|
||||
|
||||
// Format timestamp
|
||||
ts := pkt.Timestamp.Format("15:04:05.000")
|
||||
|
||||
// Detailed packet info line
|
||||
b.WriteString(fmt.Sprintf(" %d. [%s] %s %s %s:%d -> %s:%d\n",
|
||||
i+1, ts, arrow, pkt.Summary(),
|
||||
pkt.SourceIP, pkt.SourcePort, pkt.DestIP, pkt.DestPort))
|
||||
// Clean packet info line (Timestamp + Arrow + Method/Status)
|
||||
b.WriteString(fmt.Sprintf(" %d. [%s] %s %s\n", i+1, ts, arrow, pkt.Summary()))
|
||||
|
||||
// Show SDP info if present
|
||||
if pkt.SDP != nil {
|
||||
|
||||
Reference in New Issue
Block a user