ui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Colors
	ColorOnline     = lipgloss.Color("42")
	ColorOffline    = lipgloss.Color("240")
	ColorHighLat    = lipgloss.Color("214")
	ColorLocalHost  = lipgloss.Color("51")
	ColorGateway    = lipgloss.Color("220")
	ColorPort       = lipgloss.Color("177")
	ColorBorder     = lipgloss.Color("240")
	ColorActiveBord = lipgloss.Color("42")
	ColorTitle      = lipgloss.Color("255")
	ColorSubtle     = lipgloss.Color("241")
	ColorProgress   = lipgloss.Color("42")
	ColorSelected   = lipgloss.Color("39")
	ColorError      = lipgloss.Color("196")

	// Styles
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(ColorTitle)

	SubtleStyle = lipgloss.NewStyle().
				Foreground(ColorSubtle)

	OnlineStyle = lipgloss.NewStyle().
				Foreground(ColorOnline)

	OfflineStyle = lipgloss.NewStyle().
					Foreground(ColorOffline)

	HighLatStyle = lipgloss.NewStyle().
					Foreground(ColorHighLat)

	LocalStyle = lipgloss.NewStyle().
				Foreground(ColorLocalHost).
				Bold(true)

	GatewayStyle = lipgloss.NewStyle().
					Foreground(ColorGateway).
					Bold(true)

	PortStyle = lipgloss.NewStyle().
				Foreground(ColorPort)

	SelectedStyle = lipgloss.NewStyle().
					Foreground(ColorSelected).
					Bold(true)

	PanelStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(ColorBorder).
				Padding(0, 1)

	ActivePanelStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(ColorActiveBord).
						Padding(0, 1)

	HeaderStyle = lipgloss.NewStyle().
				Bold(true).
				Padding(0, 1)

	HelpStyle = lipgloss.NewStyle().
				Foreground(ColorSubtle)

	ErrorStyle = lipgloss.NewStyle().
				Foreground(ColorError)
)

Functions

func RenderDetail

func RenderDetail(host *models.Host, width, height int, active bool) string

func RenderHeader

func RenderHeader(state *models.ScanState, width int, countdown int) string

func RenderHelp

func RenderHelp(width, height int) string

func RenderTable

func RenderTable(hosts []*models.Host, selectedIdx int, width, height int, active bool, scrollOffset int) string

func RenderTopology

func RenderTopology(hosts []*models.Host, selectedIP string, width, height int, active bool, scrollOffset int) (string, int)

func SortFieldName

func SortFieldName(s SortField) string

Types

type SortField

type SortField int
const (
	SortByIP SortField = iota
	SortByLatency
	SortByPorts
	SortByVendor
)

Jump to

Keyboard shortcuts

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