Documentation
¶
Index ¶
- Variables
- func ApplyTheme(name string)
- func AvailableThemes() []string
- func BarColor(pct float64) lipgloss.Color
- func RenderBattery(bat metrics.BatteryStats) string
- func RenderCPU(cpu metrics.CPUStats, width int, history []float64) string
- func RenderDisk(delta metrics.DiskDelta, disk metrics.DiskStats, width int) string
- func RenderGPU(stats *gpu.Stats, width int, history []float64) string
- func RenderHelp(width int) string
- func RenderHelpOverlay(width, height int, version string) string
- func RenderMemory(mem metrics.MemoryStats, load metrics.LoadAvg, width int, history []float64) string
- func RenderNetwork(delta metrics.NetworkDelta, width int) string
- func RenderProcessDetail(d ProcessDetail, width, height int) string
- func RenderProcesses(procs []metrics.ProcessInfo, state ProcessViewState, width, maxRows int) string
- func RenderSparkline(values []float64, maxWidth int, color lipgloss.Color) string
- func RenderSparklineCompact(label string, values []float64, maxWidth int) string
- func RenderTemperature(temp metrics.TemperatureStats, width int) string
- func TempColor(temp float64) lipgloss.Color
- type ProcessDetail
- type ProcessViewState
- type Theme
Constants ¶
This section is empty.
Variables ¶
var ( ColorTitle = lipgloss.Color("#7D56F4") ColorGreen = lipgloss.Color("#04B575") ColorYellow = lipgloss.Color("#FBBF24") ColorRed = lipgloss.Color("#EF4444") ColorSubtle = lipgloss.Color("#6B7280") ColorBorder = lipgloss.Color("#3F3F46") ColorHeader = lipgloss.Color("#D4D4D8") ColorSelectedBg = lipgloss.Color("#3B3B5C") )
var ( TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorTitle) PanelStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(0, 1) HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorHeader) SubtleStyle = lipgloss.NewStyle(). Foreground(ColorSubtle) GreenStyle = lipgloss.NewStyle().Foreground(ColorGreen) YellowStyle = lipgloss.NewStyle().Foreground(ColorYellow) RedStyle = lipgloss.NewStyle().Foreground(ColorRed) )
Functions ¶
func ApplyTheme ¶
func ApplyTheme(name string)
ApplyTheme switches the global color variables to use the given theme. Falls back to "dark" if the theme name is not recognized.
func AvailableThemes ¶
func AvailableThemes() []string
AvailableThemes returns the names of all built-in themes.
func RenderBattery ¶
func RenderBattery(bat metrics.BatteryStats) string
RenderBattery renders the battery indicator. Returns empty if no battery.
func RenderDisk ¶
RenderDisk renders the disk panel with I/O throughput and usage.
func RenderGPU ¶
RenderGPU renders the GPU panel. Returns an empty string when GPU metrics are unavailable, causing no visual output.
func RenderHelp ¶
func RenderHelpOverlay ¶
RenderHelpOverlay renders a full-screen help overlay.
func RenderMemory ¶
func RenderNetwork ¶
func RenderNetwork(delta metrics.NetworkDelta, width int) string
RenderNetwork renders the network panel. Returns empty if no data.
func RenderProcessDetail ¶
func RenderProcessDetail(d ProcessDetail, width, height int) string
RenderProcessDetail renders a full-screen overlay with extended process info.
func RenderProcesses ¶
func RenderProcesses(procs []metrics.ProcessInfo, state ProcessViewState, width, maxRows int) string
func RenderSparkline ¶
RenderSparkline renders a sparkline from a slice of values (0-100). maxWidth limits the number of characters rendered (uses last N values).
func RenderSparklineCompact ¶
RenderSparklineCompact renders a sparkline with a label prefix.
func RenderTemperature ¶
func RenderTemperature(temp metrics.TemperatureStats, width int) string
RenderTemperature renders the temperature panel. Returns an empty string when no sensors are available.
Types ¶
type ProcessDetail ¶
type ProcessDetail struct {
metrics.ProcessInfo
Cmdline string
NumFDs int32
RSS uint64 // bytes
VMS uint64 // bytes
CreateTime int64 // milliseconds since epoch
}
ProcessDetail holds extended info for the process detail overlay.
type ProcessViewState ¶
type ProcessViewState struct {
SortBy metrics.SortField
SelectedIdx int // -1 = no selection
SearchQuery string
Searching bool
TreeView bool
HideSystem bool
TotalProcs int // total process count before filtering
}
ProcessViewState holds pure rendering state for the process panel.