tui

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Base palette
	CText   = lipgloss.Color("#c0caf5") // primary text
	CDim    = lipgloss.Color("#565f89") // muted/dim
	CBorder = lipgloss.Color("#3b4261") // panel borders

	// Accent colors
	CCyan   = lipgloss.Color("#7dcfff")
	CGreen  = lipgloss.Color("#9ece6a")
	CYellow = lipgloss.Color("#e0af68")
	CRed    = lipgloss.Color("#f7768e")
	CPurple = lipgloss.Color("#bb9af7")
	CBlue   = lipgloss.Color("#7aa2f7")
	COrange = lipgloss.Color("#ff9e64")
	CTeal   = lipgloss.Color("#73daca")

	// New accent colors
	CPink        = lipgloss.Color("#ff79c6") // upload / Tx
	CBrightGreen = lipgloss.Color("#00ff87") // download / Rx

	// 4-tier threshold colors (bright, visually distinct)
	COk       = lipgloss.Color("#00ff87") // 0-50% green
	CWarn     = lipgloss.Color("#ffd700") // 50-75% yellow
	CAlert    = lipgloss.Color("#ffaf5f") // 75-90% orange
	CCritical = lipgloss.Color("#ff5555") // 90-100% red

	// UI element colors
	CMuted = lipgloss.Color("#6c6c6c") // gray for idle/empty bar parts
	CInfo  = lipgloss.Color("#5fafff") // blue for key hints
)
View Source
var PanelIcons = map[string]string{
	"System":         "◈",
	"CPU":            "⚡",
	"Resources":      "◉",
	"Disk I/O":       "◆",
	"Network & Load": "◎",
	"Processes":      "☰",
}

PanelIcons maps panel names to their Unicode icon prefix.

Functions

func Run

func Run(ctx context.Context, stdout io.Writer, tr *i18n.Translator) error

func RunWithOptions added in v0.1.5

func RunWithOptions(ctx context.Context, opts RunOptions) error

func ThresholdColor

func ThresholdColor(pct float64) lipgloss.Color

ThresholdColor returns a color based on 4-tier thresholds: 0-50% OK, 50-75% Warn, 75-90% Alert, 90-100% Critical.

Types

type Model

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

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type RunOptions added in v0.1.5

type RunOptions struct {
	Stdout io.Writer
	Stdin  io.Reader
	TR     *i18n.Translator
}

Jump to

Keyboard shortcuts

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