Documentation
¶
Index ¶
- Variables
- func FilterNodes(filter string)
- func FilterTasks(filter string)
- func FilterVMs(filter string)
- func GetUILogger() interfaces.Logger
- func SetUILogger(logger interfaces.Logger)
- type SearchState
- type State
- func (s *State) CanVMPerformActions(vm *api.VM) bool
- func (s *State) ClearNodePending(node *api.Node)
- func (s *State) ClearVMPending(vm *api.VM)
- func (s *State) GetSearchState(component string) *SearchState
- func (s *State) GetVMPendingOperation(vm *api.VM) string
- func (s *State) HasPendingOperations() bool
- func (s *State) IsNodePending(node *api.Node) (bool, string)
- func (s *State) IsVMPending(vm *api.VM) (bool, string)
- func (s *State) SetNodePending(node *api.Node, operation string)
- func (s *State) SetVMPending(vm *api.VM, operation string)
Constants ¶
This section is empty.
Variables ¶
var GlobalState = State{ SearchStates: make(map[string]*SearchState), FilteredNodes: make([]*api.Node, 0), FilteredVMs: make([]*api.VM, 0), FilteredTasks: make([]*api.ClusterTask, 0), OriginalNodes: make([]*api.Node, 0), OriginalVMs: make([]*api.VM, 0), OriginalTasks: make([]*api.ClusterTask, 0), PendingVMOperations: make(map[string]string), PendingNodeOperations: make(map[string]string), }
GlobalState is the singleton instance for UI state.
Functions ¶
func FilterNodes ¶
func FilterNodes(filter string)
FilterNodes filters the nodes based on the given search string.
func FilterTasks ¶
func FilterTasks(filter string)
FilterTasks filters the tasks based on the given search string.
func FilterVMs ¶
func FilterVMs(filter string)
FilterVMs filters the VMs based on the given search string.
func GetUILogger ¶
func GetUILogger() interfaces.Logger
GetUILogger returns the UI logger, with fallback if not set.
func SetUILogger ¶
func SetUILogger(logger interfaces.Logger)
SetUILogger sets the shared logger instance for UI components.
Types ¶
type SearchState ¶
SearchState holds the state for a search operation.
type State ¶
type State struct {
NodeList tview.Primitive
VMList tview.Primitive
SearchStates map[string]*SearchState
// Current filtered lists
FilteredNodes []*api.Node
FilteredVMs []*api.VM
FilteredTasks []*api.ClusterTask
// Original lists
OriginalNodes []*api.Node
OriginalVMs []*api.VM
OriginalTasks []*api.ClusterTask
// Pending operations tracking
PendingVMOperations map[string]string // Key: "node:vmid", Value: operation description
PendingNodeOperations map[string]string // Key: "nodename", Value: operation description
// contains filtered or unexported fields
}
State holds all UI state components.
func (*State) CanVMPerformActions ¶ added in v1.0.6
CanVMPerformActions checks if a VM can perform actions (no pending operations). Returns true if the VM can perform actions, false otherwise.
func (*State) ClearNodePending ¶
ClearNodePending removes the pending operation status for a node.
func (*State) ClearVMPending ¶
ClearVMPending removes the pending operation status for a VM.
func (*State) GetSearchState ¶
func (s *State) GetSearchState(component string) *SearchState
GetSearchState returns the search state for a given component.
func (*State) GetVMPendingOperation ¶ added in v1.0.6
GetVMPendingOperation returns the pending operation description for a VM if any. Returns empty string if no operation is pending.
func (*State) HasPendingOperations ¶
HasPendingOperations checks if there are any pending VM or node operations.
func (*State) IsNodePending ¶
IsNodePending checks if a node has a pending operation.
func (*State) IsVMPending ¶
IsVMPending checks if a VM has a pending operation.
func (*State) SetNodePending ¶
SetNodePending marks a node as having a pending operation.