widgets

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertHistoryWidget

type AlertHistoryWidget struct {
	*tview.Table
	// contains filtered or unexported fields
}

AlertHistoryWidget displays alert history with scrolling

func NewAlertHistoryWidget

func NewAlertHistoryWidget() *AlertHistoryWidget

NewAlertHistoryWidget creates a new alert history widget

func (*AlertHistoryWidget) AddToHistory

func (w *AlertHistoryWidget) AddToHistory(alert models.Alert)

AddToHistory adds an alert to the history

func (*AlertHistoryWidget) GetSelectedAlert

func (w *AlertHistoryWidget) GetSelectedAlert() *models.Alert

GetSelectedAlert returns the currently selected alert

type AlertSummaryWidget

type AlertSummaryWidget struct {
	*tview.TextView
	// contains filtered or unexported fields
}

AlertSummaryWidget shows a compact alert summary

func NewAlertSummaryWidget

func NewAlertSummaryWidget() *AlertSummaryWidget

NewAlertSummaryWidget creates a new alert summary widget

func (*AlertSummaryWidget) UpdateCounts

func (w *AlertSummaryWidget) UpdateCounts(alerts []models.Alert)

UpdateCounts updates the alert counts

type AlertsWidget

type AlertsWidget struct {
	*tview.TextView
	// contains filtered or unexported fields
}

AlertsWidget displays active alerts

func NewAlertsWidget

func NewAlertsWidget() *AlertsWidget

NewAlertsWidget creates a new alerts widget

func (*AlertsWidget) AddAlert

func (w *AlertsWidget) AddAlert(alert models.Alert)

AddAlert adds a new alert

func (*AlertsWidget) ClearAlerts

func (w *AlertsWidget) ClearAlerts()

ClearAlerts removes all alerts

func (*AlertsWidget) GetPrimitive

func (w *AlertsWidget) GetPrimitive() tview.Primitive

GetPrimitive returns the primitive for this widget

func (*AlertsWidget) SetAlerts

func (w *AlertsWidget) SetAlerts(alerts []models.Alert)

SetAlerts updates the alerts list

type GaugeGroup

type GaugeGroup struct {
	*tview.Flex
	// contains filtered or unexported fields
}

GaugeGroup manages multiple gauges with consistent sizing

func NewGaugeGroup

func NewGaugeGroup(direction int) *GaugeGroup

NewGaugeGroup creates a new gauge group

func (*GaugeGroup) AddGauge

func (gg *GaugeGroup) AddGauge(title string, min, max float64, unit string) *GaugeWidget

AddGauge adds a gauge to the group

func (*GaugeGroup) Update

func (gg *GaugeGroup) Update(values map[string]float64)

Update updates all gauges in the group

type GaugeWidget

type GaugeWidget struct {
	*tview.Box
	// contains filtered or unexported fields
}

GaugeWidget displays a value as a horizontal gauge/progress bar

func NewGaugeWidget

func NewGaugeWidget(title string, min, max float64, unit string) *GaugeWidget

NewGaugeWidget creates a new gauge widget

func (*GaugeWidget) Draw

func (g *GaugeWidget) Draw(screen tcell.Screen)

Draw draws the gauge

func (*GaugeWidget) GetPrimitive

func (g *GaugeWidget) GetPrimitive() tview.Primitive

GetPrimitive returns the primitive for this widget

func (*GaugeWidget) SetColorFunc

func (g *GaugeWidget) SetColorFunc(f func(float64) tcell.Color)

SetColorFunc sets a custom color function

func (*GaugeWidget) SetValue

func (g *GaugeWidget) SetValue(value float64)

SetValue updates the gauge value

type HeatmapWidget

type HeatmapWidget struct {
	*tview.Box
	// contains filtered or unexported fields
}

HeatmapWidget displays a grid of values as a heatmap

func NewHeatmapWidget

func NewHeatmapWidget(title string) *HeatmapWidget

NewHeatmapWidget creates a new heatmap widget

func (*HeatmapWidget) Draw

func (h *HeatmapWidget) Draw(screen tcell.Screen)

Draw draws the heatmap

func (*HeatmapWidget) GetPrimitive

func (h *HeatmapWidget) GetPrimitive() tview.Primitive

GetPrimitive returns the primitive for this widget

func (*HeatmapWidget) GetSelectedCell

func (h *HeatmapWidget) GetSelectedCell() (row, col string, value float64, ok bool)

GetSelectedCell returns the currently selected cell

func (*HeatmapWidget) InputHandler

func (h *HeatmapWidget) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler handles input events

func (*HeatmapWidget) SetCellSize

func (h *HeatmapWidget) SetCellSize(width, height int)

SetCellSize sets the cell dimensions

func (*HeatmapWidget) SetData

func (h *HeatmapWidget) SetData(data map[string]map[string]float64)

SetData sets the heatmap data

func (*HeatmapWidget) SetScale

func (h *HeatmapWidget) SetScale(min, max float64)

SetScale sets manual scale

type NodeUtilizationHeatmap

type NodeUtilizationHeatmap struct {
	*HeatmapWidget
}

NodeUtilizationHeatmap is a specialized heatmap for node utilization

func NewNodeUtilizationHeatmap

func NewNodeUtilizationHeatmap() *NodeUtilizationHeatmap

NewNodeUtilizationHeatmap creates a heatmap optimized for node utilization display

func (*NodeUtilizationHeatmap) SetNodeMetrics

func (h *NodeUtilizationHeatmap) SetNodeMetrics(metrics map[string]map[string]float64)

SetNodeMetrics sets metrics for nodes grouped by some criteria

type SparklineGroup

type SparklineGroup struct {
	*tview.Flex
	// contains filtered or unexported fields
}

SparklineGroup manages multiple sparklines

func NewSparklineGroup

func NewSparklineGroup(direction int) *SparklineGroup

NewSparklineGroup creates a new sparkline group

func (*SparklineGroup) AddSparkline

func (sg *SparklineGroup) AddSparkline(id, title string, maxPoints int) *SparklineWidget

AddSparkline adds a sparkline to the group

func (*SparklineGroup) UpdateAll

func (sg *SparklineGroup) UpdateAll(values map[string]float64)

UpdateAll updates all sparklines with new values

func (*SparklineGroup) UpdateValue

func (sg *SparklineGroup) UpdateValue(id string, value float64)

UpdateValue updates a specific sparkline with a new value

type SparklineWidget

type SparklineWidget struct {
	*tview.Box
	// contains filtered or unexported fields
}

SparklineWidget displays a time series as a sparkline chart

func NewSparklineWidget

func NewSparklineWidget(title string, maxPoints int) *SparklineWidget

NewSparklineWidget creates a new sparkline widget

func (*SparklineWidget) AddValue

func (s *SparklineWidget) AddValue(value float64)

AddValue adds a new value to the sparkline

func (*SparklineWidget) Draw

func (s *SparklineWidget) Draw(screen tcell.Screen)

Draw draws the sparkline

func (*SparklineWidget) GetPrimitive

func (s *SparklineWidget) GetPrimitive() tview.Primitive

GetPrimitive returns the primitive for this widget

func (*SparklineWidget) SetScale

func (s *SparklineWidget) SetScale(min, max float64)

SetScale sets manual scale

func (*SparklineWidget) SetUnit

func (s *SparklineWidget) SetUnit(unit string)

SetUnit sets the unit for display

func (*SparklineWidget) SetValues

func (s *SparklineWidget) SetValues(values []float64)

SetValues sets all values at once

type TimeSeriesSparkline

type TimeSeriesSparkline struct {
	*SparklineWidget
	// contains filtered or unexported fields
}

TimeSeriesSparkline is a specialized sparkline for time series data

func NewTimeSeriesSparkline

func NewTimeSeriesSparkline(title string, timeWindow int64) *TimeSeriesSparkline

NewTimeSeriesSparkline creates a new time series sparkline

func (*TimeSeriesSparkline) AddTimedValue

func (ts *TimeSeriesSparkline) AddTimedValue(value float64, timestamp int64)

AddTimedValue adds a value with timestamp

Jump to

Keyboard shortcuts

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