feat: Add timestamp to export filename and include network context
This commit is contained in:
@@ -630,7 +630,8 @@ func (m *Model) updateSubView(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
safeCallID = strings.ReplaceAll(safeCallID, ":", "_")
|
||||
safeCallID = strings.ReplaceAll(safeCallID, "\\", "_")
|
||||
|
||||
filename := fmt.Sprintf("export_%s.log", safeCallID)
|
||||
timestamp := time.Now().Format("20060102_150405")
|
||||
filename := fmt.Sprintf("export_%s_%s.log", timestamp, safeCallID)
|
||||
err := m.exportCallToLog(flow, filename)
|
||||
if err != nil {
|
||||
m.captureError = fmt.Sprintf("Export failed: %v", err)
|
||||
@@ -1480,6 +1481,15 @@ func (m *Model) exportCallToLog(flow *sip.CallFlow, filename string) error {
|
||||
fmt.Fprintf(f, " Destination: %s (%s:%d)\n\n", dstLabel, first.DestIP, first.DestPort)
|
||||
}
|
||||
|
||||
// Network Map Context
|
||||
if len(m.networkMap.Nodes) > 0 {
|
||||
fmt.Fprintf(f, "Network Context:\n")
|
||||
for _, node := range m.networkMap.Nodes {
|
||||
fmt.Fprintf(f, " - %s (%s): %s\n", node.Name, node.Type, node.IP)
|
||||
}
|
||||
fmt.Fprintf(f, "\n")
|
||||
}
|
||||
|
||||
// Transaction Flow
|
||||
fmt.Fprintf(f, "Transaction Flow:\n")
|
||||
fmt.Fprintf(f, "-----------------\n")
|
||||
|
||||
Reference in New Issue
Block a user