historyview

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeInterface = historytree.NodeInterface
	NodeNetwork   = historytree.NodeNetwork
	NodeScan      = historytree.NodeScan
)

Variables

This section is empty.

Functions

func Render

func Render(m *Model, maxWidth int) string

Types

type Action

type Action int
const (
	ActionNone Action = iota
	ActionQuit
	ActionMoveUp
	ActionMoveDown
	ActionToggle
	ActionCollapse
	ActionDelete
	ActionConfirmYes
	ActionConfirmNo
	ActionConfirmDelete
	ActionHelp
)

func HandleKey

func HandleKey(key string, inDeleteDialog bool) Action

HandleKey converts a key press into an action

type Model

type Model struct {
	Mode            ViewMode
	Tree            []*TreeNode
	FlatList        []*TreeNode // Flattened view of expanded tree
	Cursor          int
	ShowHelp        bool
	DeleteDialog    *delete.HistoryDeleteDialog // nil when not shown
	ErrorMsg        string
	Viewport        viewport.Model
	ListOffset      int
	WindowW         int
	WindowH         int
	Details         detailsview.Model
	DetailCursors   map[string]int // remembered host cursor per scan file path
	HoveredHelpItem int            // -1 means no hover, otherwise index of helpline item
	HelpLineY       int            // Y row where the helpline starts, set during render
}

func StartDetailRescan

func StartDetailRescan(m Model, baseScanner shared.Scanner, hostIP string) (Model, tea.Cmd)

func (Model) HandleMouse

func (m Model) HandleMouse(msg tea.Msg, maxWidth int) UpdateResult

HandleMouse processes mouse events for the history list view. Scroll wheel scrolls the list; clicking a row selects or toggles it.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) SetListViewportSize

func (m Model) SetListViewportSize(windowWidth, windowHeight int) Model

SetViewportSize initializes or updates the main viewport for list view accounting for title, spacing, and help text that appear outside the viewport

func (Model) Update

func (m Model) Update(msg tea.Msg) UpdateResult

type NodeType

type NodeType = historytree.NodeType

type ScanCounts

type ScanCounts = historytree.ScanCounts

type TreeNode

type TreeNode = historytree.Node

type UpdateResult

type UpdateResult struct {
	Model           Model
	Quit            bool
	ScanAllPorts    bool
	SelectedHostIP  string
	ScanHistoryPath string
	Cmd             tea.Cmd
}

type ViewMode

type ViewMode int
const (
	ViewList ViewMode = iota
	ViewDetail
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL