dashboard

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MPL-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package dashboard implements a text-based UI dashboard.

Index

Constants

View Source
const (

	// ModeDHCP is the DHCP mode for the link.
	ModeDHCP = "DHCP"

	// ModeStatic is the static IP mode for the link.
	ModeStatic = "Static"
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cli *client.Client, opts ...Option) (runErr error)

Run starts the dashboard.

Types

type APIDataListener

type APIDataListener interface {
	OnAPIDataChange(node string, data *apidata.Data)
}

APIDataListener is a listener which is notified when API-sourced data is updated.

type ConfigURLGrid

type ConfigURLGrid struct {
	tview.Grid
	// contains filtered or unexported fields
}

ConfigURLGrid represents the config URL grid.

func NewConfigURLGrid

func NewConfigURLGrid(ctx context.Context, dashboard *Dashboard) *ConfigURLGrid

NewConfigURLGrid returns a new config URL grid.

func (*ConfigURLGrid) OnNodeSelect

func (widget *ConfigURLGrid) OnNodeSelect(node string)

OnNodeSelect implements the NodeSelectListener interface.

func (*ConfigURLGrid) OnResourceDataChange

func (widget *ConfigURLGrid) OnResourceDataChange(data resourcedata.Data)

OnResourceDataChange implements the ResourceDataListener interface.

type Dashboard

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

Dashboard implements the summary dashboard.

type LogDataListener

type LogDataListener interface {
	OnLogDataChange(node, logLine, logError string)
}

LogDataListener is a listener which is notified when a log line is received.

type MonitorGrid

type MonitorGrid struct {
	tview.Grid
	// contains filtered or unexported fields
}

MonitorGrid represents the monitoring grid with a process table and various metrics.

func NewMonitorGrid

func NewMonitorGrid(app *tview.Application) *MonitorGrid

NewMonitorGrid initializes MonitorGrid.

func (*MonitorGrid) OnAPIDataChange

func (widget *MonitorGrid) OnAPIDataChange(node string, data *apidata.Data)

OnAPIDataChange implements the APIDataListener interface.

type NetworkConfigFormData

type NetworkConfigFormData struct {
	Base        runtime.PlatformNetworkConfig
	Hostname    string
	DNSServers  string
	TimeServers string
	Iface       string
	Mode        string
	Addresses   string
	Gateway     string
}

NetworkConfigFormData is the form data for the network config.

func (*NetworkConfigFormData) ToPlatformNetworkConfig

func (formData *NetworkConfigFormData) ToPlatformNetworkConfig() (*runtime.PlatformNetworkConfig, error)

ToPlatformNetworkConfig converts the form data to a PlatformNetworkConfig.

type NetworkConfigGrid

type NetworkConfigGrid struct {
	tview.Grid
	// contains filtered or unexported fields
}

NetworkConfigGrid represents the network configuration widget.

func NewNetworkConfigGrid

func NewNetworkConfigGrid(ctx context.Context, dashboard *Dashboard) *NetworkConfigGrid

NewNetworkConfigGrid initializes NetworkConfigGrid.

func (*NetworkConfigGrid) OnNodeSelect

func (widget *NetworkConfigGrid) OnNodeSelect(node string)

OnNodeSelect implements the NodeSelectListener interface.

func (*NetworkConfigGrid) OnResourceDataChange

func (widget *NetworkConfigGrid) OnResourceDataChange(data resourcedata.Data)

OnResourceDataChange implements the ResourceDataListener interface.

type NodeSelectListener

type NodeSelectListener interface {
	OnNodeSelect(node string)
}

NodeSelectListener is a listener which is notified when a node is selected.

type Option

type Option func(*options)

Option is a functional option for Dashboard.

func WithAllowExitKeys

func WithAllowExitKeys(allowExitKeys bool) Option

WithAllowExitKeys sets whether the dashboard should allow exit keys (Ctrl + C).

func WithInterval

func WithInterval(interval time.Duration) Option

WithInterval sets the interval for the dashboard.

func WithScreens

func WithScreens(screens ...Screen) Option

WithScreens sets the screens to display. The order is preserved.

type ResourceDataListener

type ResourceDataListener interface {
	OnResourceDataChange(data resourcedata.Data)
}

ResourceDataListener is a listener which is notified when a resource is updated.

type Screen

type Screen string

Screen is a dashboard screen.

const (

	// ScreenSummary is the summary screen.
	ScreenSummary Screen = "Summary"

	// ScreenMonitor is the monitor (metrics) screen.
	ScreenMonitor Screen = "Monitor"

	// ScreenNetworkConfig is the network configuration screen.
	ScreenNetworkConfig Screen = "Network Config"

	// ScreenConfigURL is the config URL screen.
	ScreenConfigURL Screen = "Config URL"
)

type SummaryGrid

type SummaryGrid struct {
	tview.Grid
	// contains filtered or unexported fields
}

SummaryGrid represents the summary grid with the basic node information and the logs.

func NewSummaryGrid

func NewSummaryGrid(app *tview.Application) *SummaryGrid

NewSummaryGrid initializes SummaryGrid.

func (*SummaryGrid) OnAPIDataChange

func (widget *SummaryGrid) OnAPIDataChange(node string, data *apidata.Data)

OnAPIDataChange implements the APIDataListener interface.

func (*SummaryGrid) OnLogDataChange

func (widget *SummaryGrid) OnLogDataChange(node, logLine, logError string)

OnLogDataChange implements the LogDataListener interface.

func (*SummaryGrid) OnNodeSelect

func (widget *SummaryGrid) OnNodeSelect(node string)

OnNodeSelect implements the NodeSelectListener interface.

func (*SummaryGrid) OnResourceDataChange

func (widget *SummaryGrid) OnResourceDataChange(nodeResource resourcedata.Data)

OnResourceDataChange implements the ResourceDataListener interface.

Directories

Path Synopsis
Package apidata implements the types and the data sources for the data sourced from various Talos APIs.
Package apidata implements the types and the data sources for the data sourced from various Talos APIs.
Package components implements specific widgets for the dashboard.
Package components implements specific widgets for the dashboard.
Package logdata implements the types and the data sources for the data sourced from the Talos dmesg API.
Package logdata implements the types and the data sources for the data sourced from the Talos dmesg API.
Package resourcedata implements the types and the data sources for the data sourced from the Talos resource API (COSI).
Package resourcedata implements the types and the data sources for the data sourced from the Talos resource API (COSI).
Package util provides utility functions for the dashboard.
Package util provides utility functions for the dashboard.

Jump to

Keyboard shortcuts

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