Documentation
¶
Index ¶
- func Render(m *Model, windowWidth, windowHeight int) string
- type Action
- type Model
- func (m Model) HandleMouse(msg tea.MouseMsg) UpdateResult
- func (m Model) ScrollToSelected() Model
- func (m Model) SetViewportSize(windowWidth, windowHeight int) Model
- func (m Model) Update(msg tea.Msg) UpdateResult
- func (m Model) UpdateViewportContent(content string, windowWidth, windowHeight, reservedLines int) Model
- type SavedMsg
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
type Model struct {
History history.ScanHistory
HistoryPath string
Cursor int
ShowHelp bool
ErrorMsg string
Viewport viewport.Model
DeleteDialog *deletepkg.HistoryDeleteDialog
WindowW int
WindowH int
NodePath string
NodeName string
NodeItemType string
HoveredHelpItem int // -1 means no hover, otherwise index of helpline item
HelpLineY int // Y row where the helpline starts, set during render
// Rescan state
Scanning bool
ScanningHostIdx int // Index of host being scanned (-1 if none)
ProgressChan chan shared.ProgressUpdate
Stopwatch stopwatch.Model
NewPortsByHost map[string]map[int]bool // Track newly found ports per host IP
ScannedCount int
TotalHosts int
ScannedHostStr string // Last host string from scanner for the scanned host
ScanPortsScanned []int // Ports that were scanned in the current rescan
}
func (Model) HandleMouse ¶
func (m Model) HandleMouse(msg tea.MouseMsg) UpdateResult
HandleMouse processes mouse events in the detail host list: scroll wheel scrolls the viewport; left-click selects or activates a host.
func (Model) ScrollToSelected ¶
ScrollToSelected adjusts the viewport offset so the selected host is visible, showing as many of its ports as possible without pushing the host IP off-screen. During scanning it follows the scanning host, keeping new ports visible at the bottom.
func (Model) SetViewportSize ¶
SetViewportSize initializes or updates the viewport with proper dimensions accounting for title, metadata, and help text that appear outside the viewport
func (Model) UpdateViewportContent ¶
func (m Model) UpdateViewportContent(content string, windowWidth, windowHeight, reservedLines int) Model
UpdateViewportContent updates the viewport with new content and ensures proper dimensions. reservedLines is the total number of non-viewport lines (title + help, accounting for wrapping).
type SavedMsg ¶
type SavedMsg struct {
Updated history.ScanHistory
}
SavedMsg is sent after the background save+reload finishes