Documentation ¶
Overview ¶
Package dashboard implements a text-based UI dashboard.
Index ¶
- Constants
- func Run(ctx context.Context, cli *client.Client, opts ...Option) (runErr error)
- type APIDataListener
- type ConfigURLGrid
- type Dashboard
- type LogDataListener
- type MonitorGrid
- type NetworkConfigFormData
- type NetworkConfigGrid
- type NodeSelectListener
- type Option
- type ResourceDataListener
- type Screen
- type SummaryGrid
Constants ¶
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 ¶
Types ¶
type APIDataListener ¶
APIDataListener is a listener which is notified when API-sourced data is updated.
type ConfigURLGrid ¶
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 ¶
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 ¶
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 ¶
WithAllowExitKeys sets whether the dashboard should allow exit keys (Ctrl + C).
func WithInterval ¶
WithInterval sets the interval for the dashboard.
func WithScreens ¶
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 ¶
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.
Source Files ¶
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 resolver resolves the node names.
|
Package resolver resolves the node names. |
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. |