tui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertCount

type AlertCount struct {
	High   int
	Medium int
	Low    int
	Total  int
}

type AlertData

type AlertData struct {
	Recent      []core.Alert
	Count       AlertCount
	CollectedAt time.Time
}

type AlertTab

type AlertTab struct {
	// contains filtered or unexported fields
}

AlertTab shows security alerts

func (*AlertTab) HandleKey

func (t *AlertTab) HandleKey(key string) tea.Cmd

func (*AlertTab) IsDirty

func (t *AlertTab) IsDirty() bool

func (*AlertTab) SetDirty

func (t *AlertTab) SetDirty(dirty bool)

func (*AlertTab) Update

func (t *AlertTab) Update(data interface{}) tea.Cmd

func (*AlertTab) View

func (t *AlertTab) View(width, height int, theme *Theme) string

type Dashboard

type Dashboard struct {
	// contains filtered or unexported fields
}

Dashboard represents the main TUI dashboard with high performance

func NewDashboard

func NewDashboard() *Dashboard

NewDashboard creates a new high-performance TUI dashboard

func (*Dashboard) Init

func (d *Dashboard) Init() tea.Cmd

Init implements the tea.Model interface

func (*Dashboard) Run

func (d *Dashboard) Run() error

Run starts the TUI dashboard

func (*Dashboard) SetRefreshInterval

func (d *Dashboard) SetRefreshInterval(interval string)

SetRefreshInterval sets the dashboard refresh rate

func (*Dashboard) SetTheme

func (d *Dashboard) SetTheme(themeName string)

SetTheme sets the dashboard theme

func (*Dashboard) Update

func (d *Dashboard) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements the tea.Model interface

func (*Dashboard) View

func (d *Dashboard) View() string

View implements the tea.Model interface with caching

type DashboardStats

type DashboardStats struct {
	CollectionTime time.Duration
	RenderTime     time.Duration
	UpdateCount    int64
	CacheHits      int64
	CacheMisses    int64
}

DashboardStats tracks performance metrics

type DataCollector

type DataCollector interface {
	Collect() (interface{}, error)
	Type() string
}

DataCollector interface for high-performance data collection

type FastConnectionInfo

type FastConnectionInfo struct {
	LocalAddr   string
	LocalPort   uint32
	RemoteAddr  string
	RemotePort  uint32
	Status      string
	PID         int32
	ProcessName string
	Suspicious  bool
	Hash        uint64
}

type FastProcessInfo

type FastProcessInfo struct {
	PID        int32
	Name       string
	Status     string
	CPUPercent float64
	MemoryMB   float32
	CreateTime time.Time
	Suspicious bool
	Hash       uint64 // for quick comparison
}

type FileTab

type FileTab struct {
	// contains filtered or unexported fields
}

FileTab shows filesystem activity

func (*FileTab) HandleKey

func (t *FileTab) HandleKey(key string) tea.Cmd

func (*FileTab) IsDirty

func (t *FileTab) IsDirty() bool

func (*FileTab) SetDirty

func (t *FileTab) SetDirty(dirty bool)

func (*FileTab) Update

func (t *FileTab) Update(data interface{}) tea.Cmd

func (*FileTab) View

func (t *FileTab) View(width, height int, theme *Theme) string

type ListenerInfo

type ListenerInfo struct {
	Port        uint32
	Protocol    string
	ProcessName string
	PID         int32
}

type NetworkCollector

type NetworkCollector struct {
	// contains filtered or unexported fields
}

NetworkCollector implements high-performance network data collection

func NewNetworkCollector

func NewNetworkCollector() *NetworkCollector

func (*NetworkCollector) Collect

func (nc *NetworkCollector) Collect() (interface{}, error)

func (*NetworkCollector) Type

func (nc *NetworkCollector) Type() string

type NetworkData

type NetworkData struct {
	Connections []FastConnectionInfo
	Listeners   []ListenerInfo
	Total       int
	Established int
	Listening   int
	CollectedAt time.Time
}

type NetworkTab

type NetworkTab struct {
	// contains filtered or unexported fields
}

NetworkTab shows network connection information

func (*NetworkTab) HandleKey

func (t *NetworkTab) HandleKey(key string) tea.Cmd

func (*NetworkTab) IsDirty

func (t *NetworkTab) IsDirty() bool

func (*NetworkTab) SetDirty

func (t *NetworkTab) SetDirty(dirty bool)

func (*NetworkTab) Update

func (t *NetworkTab) Update(data interface{}) tea.Cmd

func (*NetworkTab) View

func (t *NetworkTab) View(width, height int, theme *Theme) string

type OverviewTab

type OverviewTab struct {
	// contains filtered or unexported fields
}

OverviewTab shows a summary of all system information

func (*OverviewTab) HandleKey

func (t *OverviewTab) HandleKey(key string) tea.Cmd

func (*OverviewTab) IsDirty

func (t *OverviewTab) IsDirty() bool

func (*OverviewTab) SetDirty

func (t *OverviewTab) SetDirty(dirty bool)

func (*OverviewTab) Update

func (t *OverviewTab) Update(data interface{}) tea.Cmd

func (*OverviewTab) View

func (t *OverviewTab) View(width, height int, theme *Theme) string

type ProcessCollector

type ProcessCollector struct {
	// contains filtered or unexported fields
}

ProcessCollector implements high-performance process data collection

func NewProcessCollector

func NewProcessCollector() *ProcessCollector

func (*ProcessCollector) Collect

func (pc *ProcessCollector) Collect() (interface{}, error)

func (*ProcessCollector) Type

func (pc *ProcessCollector) Type() string

type ProcessData

type ProcessData struct {
	Processes   []FastProcessInfo
	Total       int
	Running     int
	Sleeping    int
	Zombie      int
	CollectedAt time.Time
}

High-performance data structures

type ProcessTab

type ProcessTab struct {
	// contains filtered or unexported fields
}

ProcessTab shows detailed process information

func (*ProcessTab) HandleKey

func (t *ProcessTab) HandleKey(key string) tea.Cmd

func (*ProcessTab) IsDirty

func (t *ProcessTab) IsDirty() bool

func (*ProcessTab) SetDirty

func (t *ProcessTab) SetDirty(dirty bool)

func (*ProcessTab) Update

func (t *ProcessTab) Update(data interface{}) tea.Cmd

func (*ProcessTab) View

func (t *ProcessTab) View(width, height int, theme *Theme) string

type SystemData

type SystemData struct {
	Uptime         time.Duration
	LoadAvg        [3]float64
	MemoryUsage    float64
	DiskUsage      float64
	Temperature    float64
	CollectedAt    time.Time
	GoroutineCount int
	HeapSize       uint64
}

type SystemTab

type SystemTab struct {
	// contains filtered or unexported fields
}

SystemTab shows system information and metrics

func (*SystemTab) HandleKey

func (t *SystemTab) HandleKey(key string) tea.Cmd

func (*SystemTab) IsDirty

func (t *SystemTab) IsDirty() bool

func (*SystemTab) SetDirty

func (t *SystemTab) SetDirty(dirty bool)

func (*SystemTab) Update

func (t *SystemTab) Update(data interface{}) tea.Cmd

func (*SystemTab) View

func (t *SystemTab) View(width, height int, theme *Theme) string

type Tab

type Tab struct {
	Name    string
	Content TabContent
	// contains filtered or unexported fields
}

Tab represents a dashboard tab with caching

type TabContent

type TabContent interface {
	Update(data interface{}) tea.Cmd
	View(width, height int, theme *Theme) string
	HandleKey(key string) tea.Cmd
	IsDirty() bool
	SetDirty(bool)
}

TabContent interface for different tab implementations

type Theme

type Theme struct {
	Primary    lipgloss.Color
	Secondary  lipgloss.Color
	Accent     lipgloss.Color
	Background lipgloss.Color
	Text       lipgloss.Color
	Muted      lipgloss.Color
	Success    lipgloss.Color
	Warning    lipgloss.Color
	Error      lipgloss.Color
}

Theme defines the visual styling

Jump to

Keyboard shortcuts

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