components

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*tview.Application
	// contains filtered or unexported fields
}

App is the main application component

func NewApp

func NewApp(client *api.Client, cfg *config.Config) *App

NewApp creates a new application instance with all UI components

func (*App) CloseContextMenu

func (a *App) CloseContextMenu()

CloseContextMenu closes the context menu and restores the previous focus

func (*App) Run

func (a *App) Run() error

Run starts the application

func (*App) ShowNodeContextMenu

func (a *App) ShowNodeContextMenu()

ShowNodeContextMenu displays the context menu for node actions

func (*App) ShowVMContextMenu

func (a *App) ShowVMContextMenu()

ShowVMContextMenu displays the context menu for VM actions

type ClusterStatus

type ClusterStatus struct {
	*tview.Flex
	SummaryTable  *tview.Table
	ResourceTable *tview.Table
}

ClusterStatus encapsulates the cluster status panel

func NewClusterStatus

func NewClusterStatus() *ClusterStatus

NewClusterStatus creates a new cluster status panel

func (*ClusterStatus) Update

func (cs *ClusterStatus) Update(cluster *api.Cluster)

Update populates both tables with current cluster data

type ContextMenu

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

ContextMenu represents a popup menu with actions for a selected item

func NewContextMenu

func NewContextMenu(title string, actions []string, onAction func(index int, action string)) *ContextMenu

NewContextMenu creates a new context menu component

func (*ContextMenu) SetApp

func (cm *ContextMenu) SetApp(app *App)

SetApp sets the parent app reference

func (*ContextMenu) Show

func (cm *ContextMenu) Show() *tview.List

Show displays the context menu as a modal

type Footer struct {
	*tview.TextView
}

Footer encapsulates the application footer

func NewFooter

func NewFooter() *Footer

NewFooter creates a new application footer with key bindings

func (*Footer) UpdateKeybindings

func (f *Footer) UpdateKeybindings(text string)

UpdateKeybindings updates the footer text with custom key bindings

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

Header encapsulates the application header

func NewHeader

func NewHeader() *Header

NewHeader creates a new application header

func (*Header) SetApp

func (h *Header) SetApp(app *tview.Application)

SetApp sets the application reference for UI updates

func (*Header) SetTitle

func (h *Header) SetTitle(title string)

SetTitle updates the header text

func (*Header) ShowError

func (h *Header) ShowError(message string)

ShowError displays an error message temporarily

func (*Header) ShowLoading

func (h *Header) ShowLoading(message string)

ShowLoading displays an animated loading indicator

func (*Header) ShowSuccess

func (h *Header) ShowSuccess(message string)

ShowSuccess displays a success message temporarily

func (*Header) StopLoading

func (h *Header) StopLoading()

StopLoading stops the loading animation

type NodeDetails

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

NodeDetails encapsulates the node details panel

func NewNodeDetails

func NewNodeDetails() *NodeDetails

NewNodeDetails creates a new node details panel

func (*NodeDetails) SetApp

func (nd *NodeDetails) SetApp(app *App)

SetApp sets the parent app reference for focus management

func (*NodeDetails) Update

func (nd *NodeDetails) Update(node *api.Node, fullNodeList []*api.Node)

Update updates the node details panel with the given node

type NodeList

type NodeList struct {
	*tview.List
	// contains filtered or unexported fields
}

NodeList encapsulates the node list panel

func NewNodeList

func NewNodeList() *NodeList

NewNodeList creates a new node list component

func (*NodeList) GetSelectedNode

func (nl *NodeList) GetSelectedNode() *api.Node

GetSelectedNode returns the currently selected node

func (*NodeList) SetApp

func (nl *NodeList) SetApp(app *App)

SetApp sets the parent app reference for focus management

func (*NodeList) SetNodeChangedFunc

func (nl *NodeList) SetNodeChangedFunc(handler func(*api.Node))

SetChangedFunc sets the function to be called when selection changes

func (*NodeList) SetNodeSelectedFunc

func (nl *NodeList) SetNodeSelectedFunc(handler func(*api.Node))

SetSelectedFunc sets the function to be called when a node is selected

func (*NodeList) SetNodes

func (nl *NodeList) SetNodes(nodes []*api.Node)

SetNodes updates the list with the provided nodes

type ScriptSelector

type ScriptSelector struct {
	*tview.Modal
	// contains filtered or unexported fields
}

ScriptSelector represents a modal dialog for selecting and running community scripts

func NewScriptSelector

func NewScriptSelector(app *App, node *api.Node, vm *api.VM, user string) *ScriptSelector

NewScriptSelector creates a new script selector dialog

func (*ScriptSelector) Show

func (s *ScriptSelector) Show()

Show displays the script selector

type VMDetails

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

VMDetails encapsulates the VM details panel

func NewVMDetails

func NewVMDetails() *VMDetails

NewVMDetails creates a new VM details panel

func (*VMDetails) SetApp

func (vd *VMDetails) SetApp(app *App)

SetApp sets the parent app reference for focus management

func (*VMDetails) Update

func (vd *VMDetails) Update(vm *api.VM)

Update fills the VM details table for the given VM

type VMList

type VMList struct {
	*tview.List
	// contains filtered or unexported fields
}

VMList encapsulates the VM list panel

func NewVMList

func NewVMList() *VMList

NewVMList creates a new VM list component

func (*VMList) GetSelectedVM

func (vl *VMList) GetSelectedVM() *api.VM

GetSelectedVM returns the currently selected VM

func (*VMList) SetApp

func (vl *VMList) SetApp(app *App)

SetApp sets the parent app reference for focus management

func (*VMList) SetVMChangedFunc

func (vl *VMList) SetVMChangedFunc(handler func(*api.VM))

SetVMChangedFunc sets the function to be called when selection changes

func (*VMList) SetVMSelectedFunc

func (vl *VMList) SetVMSelectedFunc(handler func(*api.VM))

SetVMSelectedFunc sets the function to be called when a VM is selected

func (*VMList) SetVMs

func (vl *VMList) SetVMs(vms []*api.VM)

SetVMs updates the list with the provided VMs

Jump to

Keyboard shortcuts

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