portsview

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(m *Model, maxWidth int) string

func ToggleMode

func ToggleMode(portPack string) string

Types

type Action

type Action struct {
	Handled    bool
	Quit       bool
	Back       bool
	CloseHelp  bool
	OpenHelp   bool
	ToggleMode bool
	Apply      bool
	MoveLeft   bool
	MoveRight  bool
	MoveHome   bool
	MoveEnd    bool
	Backspace  bool
	DeleteAll  bool
}

func HandleKey

func HandleKey(showHelp bool, key string) Action

type Model

type Model struct {
	ShowHelp        bool
	PortPack        string
	CustomPorts     string
	CustomCursor    int
	PortInput       common.CustomPortInput
	ErrorMsg        string
	NetworkScan     shared.Scanner
	HoveredHelpItem int // -1 means no hover, otherwise index of helpline item
	HelpLineY       int // Y row where the helpline starts, set during render
}

func Prepare

func Prepare(m Model) (Model, tea.Cmd)

func (Model) HandleMouse

func (m Model) HandleMouse(msg tea.MouseMsg, maxWidth int) Result

HandleMouse processes a mouse event for the ports view. Clicking the default or custom row selects it; clicking the active row applies.

func (Model) Update

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

type Result

type Result struct {
	Model Model
	Cmd   tea.Cmd
	Quit  bool
	Back  bool
	Done  bool
}

Jump to

Keyboard shortcuts

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