feat: Enhance export with IPs and add controls legend to TUI
This commit is contained in:
@@ -401,7 +401,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
leftW := innerW / 2
|
leftW := innerW / 2
|
||||||
rightW := innerW - leftW
|
rightW := innerW - leftW
|
||||||
|
|
||||||
leftTotalH := m.height - 3
|
leftTotalH := m.height - 4 // -4 for Nav, Status, and Help Footer
|
||||||
leftTopH := leftTotalH / 3
|
leftTopH := leftTotalH / 3
|
||||||
if leftTopH < 10 {
|
if leftTopH < 10 {
|
||||||
leftTopH = 10
|
leftTopH = 10
|
||||||
@@ -927,7 +927,7 @@ func (m Model) renderCallDetail() string {
|
|||||||
rightW := innerW - leftW
|
rightW := innerW - leftW
|
||||||
|
|
||||||
// Left Pane Heights
|
// Left Pane Heights
|
||||||
leftTotalH := m.height - 3 // Nav + Status
|
leftTotalH := m.height - 4 // Nav + Status + Help Footer
|
||||||
// Adjust for borders: we have two boxes stacked.
|
// Adjust for borders: we have two boxes stacked.
|
||||||
// Let's say we split space 33% / 66%.
|
// Let's say we split space 33% / 66%.
|
||||||
leftTopH := leftTotalH / 3
|
leftTopH := leftTotalH / 3
|
||||||
@@ -1048,7 +1048,10 @@ func (m Model) renderCallDetail() string {
|
|||||||
rightContent := lipgloss.JoinVertical(lipgloss.Left, flowTitle, "\n", m.viewport.View())
|
rightContent := lipgloss.JoinVertical(lipgloss.Left, flowTitle, "\n", m.viewport.View())
|
||||||
rightRendered := rightStyle.Render(rightContent)
|
rightRendered := rightStyle.Render(rightContent)
|
||||||
|
|
||||||
return lipgloss.JoinHorizontal(lipgloss.Top, leftCol, rightRendered)
|
content := lipgloss.JoinHorizontal(lipgloss.Top, leftCol, rightRendered)
|
||||||
|
|
||||||
|
help := m.styles.Help.Render("[Tab] Switch Pane • [↑/↓] Scroll • [e] Export Log • [Esc] Back")
|
||||||
|
return lipgloss.JoinVertical(lipgloss.Left, content, help)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m Model) renderNav() string {
|
func (m Model) renderNav() string {
|
||||||
@@ -1481,7 +1484,14 @@ func (m *Model) exportCallToLog(flow *sip.CallFlow, filename string) error {
|
|||||||
|
|
||||||
// Resolve IPs
|
// Resolve IPs
|
||||||
src := m.networkMap.LabelForIP(pkt.SourceIP)
|
src := m.networkMap.LabelForIP(pkt.SourceIP)
|
||||||
|
if src != pkt.SourceIP {
|
||||||
|
src = fmt.Sprintf("%s (%s)", src, pkt.SourceIP)
|
||||||
|
}
|
||||||
|
|
||||||
dst := m.networkMap.LabelForIP(pkt.DestIP)
|
dst := m.networkMap.LabelForIP(pkt.DestIP)
|
||||||
|
if dst != pkt.DestIP {
|
||||||
|
dst = fmt.Sprintf("%s (%s)", dst, pkt.DestIP)
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Fprintf(f, "%d. [%s] %s %s %s (%s line %d)\n",
|
fmt.Fprintf(f, "%d. [%s] %s %s %s (%s line %d)\n",
|
||||||
i+1,
|
i+1,
|
||||||
|
|||||||
Reference in New Issue
Block a user