Documentation
¶
Overview ¶
Package components implements specific widgets for the dashboard.
Index ¶
- func FormatStatus(status any) string
- func FormatText(text string, ok bool) string
- type BaseGraph
- type BaseSparklineGroup
- type CPUInfo
- type Diagnostics
- type Footer
- type Header
- type HorizontalLine
- type KubernetesInfo
- type LoadAvgInfo
- type LogViewer
- type MemInfo
- type NetworkInfo
- type ProcessTable
- type ProcsInfo
- type SystemGauges
- type TalosInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatStatus ¶ added in v1.12.12
func FormatText ¶ added in v1.12.12
Types ¶
type BaseGraph ¶
BaseGraph represents the widget with some usage graph.
func NewBaseGraph ¶
NewBaseGraph initializes BaseGraph.
type BaseSparklineGroup ¶
BaseSparklineGroup represents the widget with some sparklines.
func NewBaseSparklineGroup ¶
func NewBaseSparklineGroup(title string, labels, dataLabels []string) *BaseSparklineGroup
NewBaseSparklineGroup initializes BaseSparklineGroup.
func NewDiskSparkline ¶
func NewDiskSparkline() *BaseSparklineGroup
NewDiskSparkline creates disk sparkline.
func NewNetSparkline ¶
func NewNetSparkline() *BaseSparklineGroup
NewNetSparkline creates network sparkline.
func (*BaseSparklineGroup) OnAPIDataChange ¶
func (widget *BaseSparklineGroup) OnAPIDataChange(node string, data *apidata.Data)
OnAPIDataChange implements the APIDataListener interface.
type Diagnostics ¶ added in v1.8.0
Diagnostics represents the diagnostics widget.
func NewDiagnostics ¶ added in v1.8.0
func NewDiagnostics() *Diagnostics
NewDiagnostics initializes Diagnostics.
func (*Diagnostics) GetCurrentHeight ¶ added in v1.8.0
func (widget *Diagnostics) GetCurrentHeight() int
GetCurrentHeight returns the height of the widget.
func (*Diagnostics) OnNodeSelect ¶ added in v1.8.0
func (widget *Diagnostics) OnNodeSelect(node string)
OnNodeSelect implements the NodeSelectListener interface.
func (*Diagnostics) OnResourceDataChange ¶ added in v1.8.0
func (widget *Diagnostics) OnResourceDataChange(data resourcedata.Data)
OnResourceDataChange implements the ResourceDataListener interface.
type Footer ¶
type Footer struct {
NodeClick func(node string)
ScreenClick func(screen string)
// contains filtered or unexported fields
}
Footer represents the top bar with host info.
func (*Footer) Draw ¶ added in v1.14.0
Draw renders the footer, windowing the node list to the available width so the selected node and the screen tabs always stay visible.
func (*Footer) OnNodeSelect ¶
OnNodeSelect implements the NodeSelectListener interface.
func (*Footer) Render ¶ added in v1.14.0
Render rebuilds the footer text and the mouse-click hit regions for the given inner width.
The footer format is: [node1 | node2 | node3] --- [F1: Screen1] --- [Screen2] --- ... where the selected node/screen is highlighted in red.
The screens section (and the PAUSED indicator) is always rendered in full; the node list gets the remaining width and is windowed around the selected node so it stays visible. "‹"/"›" indicators are shown when nodes are hidden to the left/right. Hit regions track the x-offset ranges of each visible node and screen label.
func (*Footer) SelectScreen ¶
SelectScreen refreshes the footer with the tabs and screens data.
type Header ¶
Header represents the top bar with host info.
func (*Header) OnAPIDataChange ¶
OnAPIDataChange implements the APIDataListener interface.
func (*Header) OnNodeSelect ¶
OnNodeSelect implements the NodeSelectListener interface.
func (*Header) OnResourceDataChange ¶
func (widget *Header) OnResourceDataChange(data resourcedata.Data)
OnResourceDataChange implements the ResourceDataListener interface.
type HorizontalLine ¶
HorizontalLine is a widget that draws a horizontal line.
func NewHorizontalLine ¶
func NewHorizontalLine(label string) *HorizontalLine
NewHorizontalLine initializes HorizontalLine.
type KubernetesInfo ¶
KubernetesInfo represents the kubernetes info widget.
func NewKubernetesInfo ¶
func NewKubernetesInfo() *KubernetesInfo
NewKubernetesInfo initializes KubernetesInfo.
func (*KubernetesInfo) Configured ¶ added in v1.14.0
func (widget *KubernetesInfo) Configured() bool
Configured returns true if Kubernetes is configured on the selected node.
Kubernetes is assumed to be configured if the Kubernetes version was detected.
func (*KubernetesInfo) OnAPIDataChange ¶
func (widget *KubernetesInfo) OnAPIDataChange(node string, data *apidata.Data)
OnAPIDataChange implements the APIDataListener interface.
func (*KubernetesInfo) OnNodeSelect ¶
func (widget *KubernetesInfo) OnNodeSelect(node string)
OnNodeSelect implements the NodeSelectListener interface.
func (*KubernetesInfo) OnResourceDataChange ¶
func (widget *KubernetesInfo) OnResourceDataChange(data resourcedata.Data)
OnResourceDataChange implements the ResourceDataListener interface.
type LoadAvgInfo ¶
LoadAvgInfo represents the widget with load average info.
func (*LoadAvgInfo) OnAPIDataChange ¶
func (widget *LoadAvgInfo) OnAPIDataChange(node string, data *apidata.Data)
OnAPIDataChange implements the APIDataListener interface.
type LogViewer ¶
LogViewer represents the logs widget.
func NewLogViewer ¶
func NewLogViewer(app *tview.Application) *LogViewer
NewLogViewer initializes LogViewer.
type NetworkInfo ¶
NetworkInfo represents the network info widget.
func (*NetworkInfo) OnNodeSelect ¶
func (widget *NetworkInfo) OnNodeSelect(node string)
OnNodeSelect implements the NodeSelectListener interface.
func (*NetworkInfo) OnResourceDataChange ¶
func (widget *NetworkInfo) OnResourceDataChange(data resourcedata.Data)
OnResourceDataChange implements the ResourceDataListener interface.
type ProcessTable ¶
ProcessTable represents the widget with process info.
func NewProcessTable ¶
func NewProcessTable() *ProcessTable
NewProcessTable initializes ProcessTable.
func (*ProcessTable) OnAPIDataChange ¶
func (widget *ProcessTable) OnAPIDataChange(node string, data *apidata.Data)
OnAPIDataChange implements the APIDataListener interface.
type SystemGauges ¶
SystemGauges quickly show CPU/mem load.
func (*SystemGauges) OnAPIDataChange ¶
func (widget *SystemGauges) OnAPIDataChange(node string, data *apidata.Data)
OnAPIDataChange implements the APIDataListener interface.
type TalosInfo ¶
TalosInfo represents the Talos info widget.
func (*TalosInfo) OnNodeSelect ¶
OnNodeSelect implements the NodeSelectListener interface.
func (*TalosInfo) OnResourceDataChange ¶
func (widget *TalosInfo) OnResourceDataChange(data resourcedata.Data)
OnResourceDataChange implements the ResourceDataListener interface.