dashboard

package
v0.0.0-...-9759625 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package dashboard renders the wrongtop overview tab: a btop-style single-screen grid of host, CPU, memory, network, disk and top-process panels. Each panel carries its live readout on the border line — title left, value right — with alert chips in the app-level tab bar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Key  string
	Text string
	Crit bool
}

Alert is one threshold crossing. Key identifies the metric so the app-level alert history can track start and end of each condition.

func EvaluateAlerts

func EvaluateAlerts(cfg *config.Config, snap collector.Snapshot) []Alert

EvaluateAlerts collects threshold crossings, glances-style. Critical findings sort before warnings so the strip leads with the worst. A nil snapshot (never received one) yields no alerts.

type Model

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

Model is the dashboard tab.

func New

func New(cfg *config.Config, th *theme.Theme) *Model

New builds the dashboard tab. Graph ramps come from the theme so the graphs and the meters always read the same palette story.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize implements ui.Tab.

func (*Model) SetTheme

func (m *Model) SetTheme(th *theme.Theme)

SetTheme implements ui.Tab; graph ramps derive from the palette so they must be rebuilt alongside the styles.

func (*Model) SetVisible

func (m *Model) SetVisible(bool)

SetVisible implements ui.Tab. The dashboard keeps pushing graph history while hidden (that is the point of a warm dashboard); its view cache already makes rebuilds lazy.

func (*Model) Title

func (m *Model) Title() string

Title implements ui.Tab.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) tea.Cmd

Update implements ui.Tab.

func (*Model) View

func (m *Model) View() string

View implements ui.Tab. The rendered frame is cached: View runs after every event (mouse, keys, focus), but the output only changes when a snapshot lands or the size/theme/density changes.

Jump to

Keyboard shortcuts

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