Documentation
¶
Index ¶
- Constants
- func CreateAboutDialog(versionInfo *version.BuildInfo, onClose func()) tview.Primitive
- func CreateConfirmDialog(title, message string, onConfirm, onCancel func()) *tview.Modal
- func CreateErrorDialog(title, message string, onClose func()) *tview.Modal
- func CreateErrorDialogWithScrollableText(title, message string, onClose func()) *tview.Modal
- func CreateFormDialog(title string, fields []FormField, onSubmit, onCancel func(map[string]string)) *tview.Form
- func CreateInfoDialog(title, message string, onClose func()) *tview.Modal
- func CreateLoginForm() *tview.Form
- func CreateSuccessDialogWithURL(title, message string, onClose func()) *tview.Modal
- func FormatFooterText(keys config.KeyBindings) string
- func NewConfigWizardPage(app *tview.Application, cfg *config.Config, configPath string, ...) tview.Primitive
- func SaveConfigToFile(cfg *config.Config, path string) error
- type App
- func (a *App) ClearAPICache()
- func (a *App) Client() *api.Client
- func (a *App) CloseConnectionProfilesMenu()
- func (a *App) CloseContextMenu()
- func (a *App) Config() *config.Config
- func (a *App) Footer() FooterComponent
- func (a *App) GetActiveBackupsForVM(vmid int) []*taskpoller.TaskInfo
- func (a *App) GetVNCService() *vnc.Service
- func (a *App) GroupManager() *api.GroupClientManager
- func (a *App) Header() HeaderComponent
- func (a *App) InitializePlugins(ctx context.Context, plugins []Plugin) error
- func (a *App) IsGroupMode() bool
- func (a *App) IsPluginModal(pageName string) bool
- func (a *App) ManualRefresh()
- func (a *App) NodeList() NodeListComponent
- func (a *App) Pages() *tview.Pages
- func (a *App) RegisterBackupCallback(callback func()) func()
- func (a *App) Run() error
- func (a *App) SetHotkeyOverride(handler func(*tcell.EventKey) *tcell.EventKey)
- func (a *App) SetPluginCatalog(catalog []PluginInfo)
- func (a *App) ShowGlobalContextMenu()
- func (a *App) ShowMessage(message string)
- func (a *App) ShowMessageSafe(message string)
- func (a *App) ShowNodeContextMenu()
- func (a *App) ShowVMContextMenu()
- func (a *App) ShutdownPlugins(ctx context.Context) error
- func (a *App) StartBackupMonitor(upid, nodeName string, vmid int)
- func (a *App) TaskManager() *taskmanager.TaskManager
- func (a *App) VMList() VMListComponent
- type BackupForm
- type BackupManager
- type BackupOperations
- type BackupTable
- type ButtonAlignment
- type ClusterStatus
- type ClusterStatusComponent
- type ContextMenu
- type EnhancedNetworkInterface
- type Footer
- func (f *Footer) IsLoading() bool
- func (f *Footer) SetLoading(loading bool)
- func (f *Footer) TickSpinner()
- func (f *Footer) UpdateAutoRefreshCountdown(seconds int)
- func (f *Footer) UpdateAutoRefreshStatus(active bool)
- func (f *Footer) UpdateKeybindings(text string)
- func (f *Footer) UpdateSelectedGuestsCount(count int)
- func (f *Footer) UpdateVNCSessionCount(count int)
- type FooterComponent
- type FormButton
- func (b *FormButton) Blur()
- func (b *FormButton) Draw(screen tcell.Screen)
- func (b *FormButton) Focus(delegate func(p tview.Primitive))
- func (b *FormButton) GetFieldHeight() int
- func (b *FormButton) GetFieldWidth() int
- func (b *FormButton) GetLabel() string
- func (b *FormButton) HasFocus() bool
- func (b *FormButton) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (b *FormButton) IsDisabled() bool
- func (b *FormButton) SetAlignment(alignment ButtonAlignment) *FormButton
- func (b *FormButton) SetCustomPosition(x, y int) *FormButton
- func (b *FormButton) SetDisabled(disabled bool) tview.FormItem
- func (b *FormButton) SetFieldWidth(width int) tview.FormItem
- func (b *FormButton) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem
- func (b *FormButton) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem
- func (b *FormButton) SetLabel(label string) tview.FormItem
- func (b *FormButton) SetSelectedFunc(handler func()) *FormButton
- type FormField
- type GuestAction
- type GuestActionHandler
- type Header
- func (h *Header) GetCurrentProfile() string
- func (h *Header) IsLoading() bool
- func (h *Header) SetApp(app *tview.Application)
- func (h *Header) SetText(text string)
- func (h *Header) SetTitle(title string)
- func (h *Header) ShowActiveProfile(profileName string)
- func (h *Header) ShowError(message string)
- func (h *Header) ShowLoading(message string)
- func (h *Header) ShowSuccess(message string)
- func (h *Header) ShowWarning(message string)
- func (h *Header) StopLoading()
- type HeaderComponent
- type HelpModal
- type NodeAction
- type NodeActionHandler
- type NodeDetails
- type NodeDetailsComponent
- type NodeList
- func (nl *NodeList) GetNodes() []*api.Node
- func (nl *NodeList) GetSelectedNode() *api.Node
- func (nl *NodeList) SetApp(app *App)
- func (nl *NodeList) SetCurrentItem(index int) *tview.List
- func (nl *NodeList) SetNodeChangedFunc(handler func(*api.Node))
- func (nl *NodeList) SetNodeSelectedFunc(handler func(*api.Node))
- func (nl *NodeList) SetNodes(nodes []*api.Node)
- type NodeListComponent
- type Plugin
- type PluginInfo
- type PluginRegistrar
- type SnapshotForm
- type SnapshotManager
- type SnapshotOperations
- func (so *SnapshotOperations) CreateSnapshot(name string, description string, vmState bool) error
- func (so *SnapshotOperations) DeleteSnapshot(snapshotName string) error
- func (so *SnapshotOperations) GetSnapshots() ([]api.Snapshot, error)
- func (so *SnapshotOperations) RollbackToSnapshot(snapshotName string) error
- type SnapshotTable
- type TasksList
- func (tl *TasksList) Clear() *tview.Table
- func (tl *TasksList) GetSelectedTask() *api.ClusterTask
- func (tl *TasksList) Refresh()
- func (tl *TasksList) Select(row, column int) *tview.Table
- func (tl *TasksList) SetApp(app *App)
- func (tl *TasksList) SetFilteredTasks(tasks []*api.ClusterTask)
- func (tl *TasksList) SetTasks(tasks []*api.ClusterTask)
- type TasksListComponent
- type VMConfigPage
- type VMDetails
- type VMDetailsComponent
- type VMList
- func (vl *VMList) GetNodeForVM(vm *api.VM) *api.Node
- func (vl *VMList) GetSelectedVM() *api.VM
- func (vl *VMList) GetVMs() []*api.VM
- func (vl *VMList) SetApp(app *App)
- func (vl *VMList) SetCurrentItem(index int) *tview.List
- func (vl *VMList) SetVMChangedFunc(handler func(*api.VM))
- func (vl *VMList) SetVMSelectedFunc(handler func(*api.VM))
- func (vl *VMList) SetVMs(vms []*api.VM)
- type VMListComponent
- type WideModal
- func (m *WideModal) AddButtons(labels []string) *WideModal
- func (m *WideModal) ClearButtons() *WideModal
- func (m *WideModal) Draw(screen tcell.Screen)
- func (m *WideModal) Focus(delegate func(p tview.Primitive))
- func (m *WideModal) HasFocus() bool
- func (m *WideModal) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
- func (m *WideModal) MouseHandler() ...
- func (m *WideModal) SetBackgroundColor(color tcell.Color) *WideModal
- func (m *WideModal) SetButtonActivatedStyle(style tcell.Style) *WideModal
- func (m *WideModal) SetButtonBackgroundColor(color tcell.Color) *WideModal
- func (m *WideModal) SetButtonStyle(style tcell.Style) *WideModal
- func (m *WideModal) SetButtonTextColor(color tcell.Color) *WideModal
- func (m *WideModal) SetDoneFunc(handler func(buttonIndex int, buttonLabel string)) *WideModal
- func (m *WideModal) SetFocus(index int) *WideModal
- func (m *WideModal) SetText(text string) *WideModal
- func (m *WideModal) SetTextColor(color tcell.Color) *WideModal
- type WizardResult
Constants ¶
const (
CurrentSnapshotName = "current"
)
Variables ¶
This section is empty.
Functions ¶
func CreateAboutDialog ¶
CreateAboutDialog creates an about dialog with version information and links.
func CreateConfirmDialog ¶
CreateConfirmDialog creates a confirmation dialog.
func CreateErrorDialog ¶
CreateErrorDialog creates an error dialog.
func CreateErrorDialogWithScrollableText ¶
CreateErrorDialogWithScrollableText creates an error dialog with scrollable text for long URLs.
func CreateFormDialog ¶
func CreateFormDialog(title string, fields []FormField, onSubmit, onCancel func(map[string]string)) *tview.Form
CreateFormDialog creates a form dialog with custom fields.
func CreateInfoDialog ¶
CreateInfoDialog creates an information dialog.
func CreateLoginForm ¶
CreateLoginForm creates a login form dialog.
func CreateSuccessDialogWithURL ¶
CreateSuccessDialogWithURL creates a success dialog with URL information for VNC connections.
func FormatFooterText ¶
func FormatFooterText(keys config.KeyBindings) string
FormatFooterText builds the footer key binding text from config.
func NewConfigWizardPage ¶
func NewConfigWizardPage(app *tview.Application, cfg *config.Config, configPath string, saveFn func(*config.Config) error, cancelFn func(), resultChan chan<- WizardResult, targetProfile string) tview.Primitive
NewConfigWizardPage creates a new configuration wizard page.
Types ¶
type App ¶
type App struct {
*tview.Application
// contains filtered or unexported fields
}
App is the main application component.
func NewApp ¶
func NewApp(ctx context.Context, client *api.Client, cfg *config.Config, configPath string, initialGroup string) *App
NewApp creates a new application instance with all UI components.
func (*App) ClearAPICache ¶ added in v1.0.7
func (a *App) ClearAPICache()
ClearAPICache clears cached API responses.
func (*App) CloseConnectionProfilesMenu ¶
func (a *App) CloseConnectionProfilesMenu()
func (*App) CloseContextMenu ¶
func (a *App) CloseContextMenu()
CloseContextMenu closes the context menu and restores the previous focus.
func (*App) Footer ¶ added in v1.0.7
func (a *App) Footer() FooterComponent
Footer returns the footer component instance.
func (*App) GetActiveBackupsForVM ¶ added in v1.0.15
func (a *App) GetActiveBackupsForVM(vmid int) []*taskpoller.TaskInfo
GetActiveBackupsForVM returns a list of active backups for a specific VM.
func (*App) GetVNCService ¶
GetVNCService returns the VNC service instance.
func (*App) GroupManager ¶ added in v1.0.14
func (a *App) GroupManager() *api.GroupClientManager
GroupManager returns the group client manager if in group mode, nil otherwise.
func (*App) Header ¶ added in v1.0.7
func (a *App) Header() HeaderComponent
Header returns the header component instance.
func (*App) InitializePlugins ¶ added in v1.0.7
InitializePlugins wires the provided plugins into the application lifecycle.
func (*App) IsGroupMode ¶ added in v1.0.14
IsGroupMode returns whether the app is running in group cluster mode.
func (*App) IsPluginModal ¶ added in v1.0.9
IsPluginModal checks if the given page name is registered as a plugin modal. This is used by the global keyboard handler to determine if global keybindings should be suppressed when a plugin modal is active.
func (*App) ManualRefresh ¶ added in v1.0.7
func (a *App) ManualRefresh()
ManualRefresh triggers a manual refresh cycle.
func (*App) NodeList ¶ added in v1.0.7
func (a *App) NodeList() NodeListComponent
NodeList exposes the node list component.
func (*App) RegisterBackupCallback ¶ added in v1.0.15
func (a *App) RegisterBackupCallback(callback func()) func()
RegisterBackupCallback registers a callback for backup state changes. Returns a function to unregister the callback.
func (*App) SetHotkeyOverride ¶ added in v1.0.14
SetHotkeyOverride installs a temporary handler that runs before global shortcuts. Return nil from the handler to swallow the event; otherwise return the event (optionally mutated) to allow further processing. Pass nil to clear.
func (*App) SetPluginCatalog ¶ added in v1.0.7
func (a *App) SetPluginCatalog(catalog []PluginInfo)
SetPluginCatalog stores metadata about available plugins for later UI use.
func (*App) ShowGlobalContextMenu ¶
func (a *App) ShowGlobalContextMenu()
ShowGlobalContextMenu displays the global context menu for app-wide actions.
func (*App) ShowMessage ¶ added in v1.0.7
ShowMessage displays a modal message, preserving focus when dismissed. This now uses a safe implementation that avoids QueueUpdateDraw deadlocks.
func (*App) ShowMessageSafe ¶ added in v1.0.7
ShowMessageSafe is now an alias to ShowMessage for backwards compatibility. Both use the same safe implementation that avoids QueueUpdateDraw deadlocks.
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.
func (*App) ShutdownPlugins ¶ added in v1.0.7
ShutdownPlugins gracefully tears down registered plugins.
func (*App) StartBackupMonitor ¶ added in v1.0.15
StartBackupMonitor starts monitoring a backup task.
func (*App) TaskManager ¶ added in v1.0.18
func (a *App) TaskManager() *taskmanager.TaskManager
TaskManager returns the application task manager.
func (*App) VMList ¶ added in v1.0.7
func (a *App) VMList() VMListComponent
VMList exposes the VM list component.
type BackupForm ¶ added in v1.0.15
type BackupForm struct {
// contains filtered or unexported fields
}
BackupForm manages the create backup form.
func NewBackupForm ¶ added in v1.0.15
func NewBackupForm(app *App, vm *api.VM) *BackupForm
NewBackupForm creates a new backup form handler.
func (*BackupForm) SetTaskStartedCallback ¶ added in v1.0.15
func (bf *BackupForm) SetTaskStartedCallback(callback func(upid string))
SetTaskStartedCallback sets the callback for when a backup task starts.
func (*BackupForm) ShowCreateForm ¶ added in v1.0.15
func (bf *BackupForm) ShowCreateForm(onSuccess func())
ShowCreateForm displays the create backup form.
type BackupManager ¶ added in v1.0.15
BackupManager manages the backup interface for VMs and containers.
func NewBackupManager ¶ added in v1.0.15
func NewBackupManager(app *App, vm *api.VM) *BackupManager
NewBackupManager creates a new backup manager for the given VM.
type BackupOperations ¶ added in v1.0.15
type BackupOperations struct {
// contains filtered or unexported fields
}
BackupOperations handles backup CRUD operations.
func NewBackupOperations ¶ added in v1.0.15
func NewBackupOperations(app *App, vm *api.VM) *BackupOperations
NewBackupOperations creates a new backup operations handler.
func (*BackupOperations) CreateBackup ¶ added in v1.0.15
func (bo *BackupOperations) CreateBackup(options api.BackupOptions) (string, error)
CreateBackup creates a new backup with the given options.
func (*BackupOperations) DeleteBackup ¶ added in v1.0.15
func (bo *BackupOperations) DeleteBackup(volID string) error
DeleteBackup deletes the specified backup.
func (*BackupOperations) GetBackups ¶ added in v1.0.15
func (bo *BackupOperations) GetBackups() ([]api.Backup, error)
GetBackups retrieves all backups for the VM.
func (*BackupOperations) RestoreBackup ¶ added in v1.0.15
func (bo *BackupOperations) RestoreBackup(volID string) (string, error)
RestoreBackup restores the specified backup.
type BackupTable ¶ added in v1.0.15
BackupTable manages the backup list display and selection.
func NewBackupTable ¶ added in v1.0.15
func NewBackupTable(app *App, vm *api.VM) *BackupTable
NewBackupTable creates a new backup table.
func (*BackupTable) DisplayBackups ¶ added in v1.0.15
func (bt *BackupTable) DisplayBackups(backups []api.Backup)
DisplayBackups displays the backups in the table.
func (*BackupTable) GetSelectedBackup ¶ added in v1.0.15
func (bt *BackupTable) GetSelectedBackup() *api.Backup
GetSelectedBackup gets the currently selected backup.
type ButtonAlignment ¶
type ButtonAlignment int
ButtonAlignment defines how the button should be positioned within its container.
const ( // AlignCenter centers the button horizontally (default) AlignCenter ButtonAlignment = iota // AlignLeft aligns the button to the left AlignLeft // AlignRight aligns the button to the right AlignRight // AlignCustom uses custom positioning (x, y coordinates) AlignCustom )
type ClusterStatus ¶
type ClusterStatus struct {
*tview.Flex
SummaryTable *tview.Table
ResourceTable *tview.Table
// contains filtered or unexported fields
}
ClusterStatus encapsulates the cluster status panel.
func NewClusterStatus ¶
func NewClusterStatus() *ClusterStatus
NewClusterStatus creates a new cluster status panel.
func (*ClusterStatus) SetApp ¶
func (cs *ClusterStatus) SetApp(app *App)
SetApp sets the application reference.
func (*ClusterStatus) Update ¶
func (cs *ClusterStatus) Update(cluster *api.Cluster)
Update populates both tables with current cluster data.
type ClusterStatusComponent ¶
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 NewContextMenuWithShortcuts ¶
func NewContextMenuWithShortcuts(title string, actions []string, shortcuts []rune, onAction func(index int, action string)) *ContextMenu
NewContextMenuWithShortcuts creates a new context menu component with custom shortcuts.
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 EnhancedNetworkInterface ¶
type EnhancedNetworkInterface struct {
// From configuration
Interface string
Model string
MACAddr string
Bridge string
VLAN string
Rate string
ConfiguredIP string
Gateway string
Firewall bool
// From guest agent
RuntimeName string
RuntimeIPs []string
IsUp bool
HasGuestAgent bool
IsGuestOnly bool // True if this interface is only visible via guest agent
}
EnhancedNetworkInterface represents enhanced network information with both config and runtime data.
type Footer ¶
type Footer struct {
// contains filtered or unexported fields
}
Footer encapsulates the application footer.
func NewFooter ¶
func NewFooter() *Footer
NewFooter creates a new application footer with key bindings.
func (*Footer) IsLoading ¶
IsLoading returns true if the footer is currently showing a loading spinner.
func (*Footer) SetLoading ¶
SetLoading sets the loading state and resets the spinner.
func (*Footer) TickSpinner ¶
func (f *Footer) TickSpinner()
TickSpinner advances the loading spinner animation once.
func (*Footer) UpdateAutoRefreshCountdown ¶
UpdateAutoRefreshCountdown updates the countdown for the next auto-refresh.
func (*Footer) UpdateAutoRefreshStatus ¶
UpdateAutoRefreshStatus updates the auto-refresh status display.
func (*Footer) UpdateKeybindings ¶
UpdateKeybindings updates the footer text with custom key bindings.
func (*Footer) UpdateSelectedGuestsCount ¶ added in v1.0.19
UpdateSelectedGuestsCount updates the selected guest counter in the footer status area.
func (*Footer) UpdateVNCSessionCount ¶
UpdateVNCSessionCount updates the VNC session count display.
type FooterComponent ¶
type FormButton ¶
FormButton is a reusable FormItem that acts like a button and can be placed anywhere in a tview.Form.
func NewFormButton ¶
func NewFormButton(label string, selected func()) *FormButton
NewFormButton creates a new FormButton with the given label and callback.
func (*FormButton) Draw ¶
func (b *FormButton) Draw(screen tcell.Screen)
Draw renders the button by delegating to the embedded tview.Button.
func (*FormButton) Focus ¶
func (b *FormButton) Focus(delegate func(p tview.Primitive))
Focus sets the button as focused.
func (*FormButton) GetFieldHeight ¶
func (b *FormButton) GetFieldHeight() int
GetFieldHeight returns the height of the button (always 1).
func (*FormButton) GetFieldWidth ¶
func (b *FormButton) GetFieldWidth() int
GetFieldWidth returns the width of the button (label length).
func (*FormButton) GetLabel ¶
func (b *FormButton) GetLabel() string
GetLabel returns the button label.
func (*FormButton) HasFocus ¶
func (b *FormButton) HasFocus() bool
HasFocus returns true if the button is focused.
func (*FormButton) InputHandler ¶
func (b *FormButton) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))
InputHandler handles key events for the button by delegating to the embedded button.
func (*FormButton) IsDisabled ¶
func (b *FormButton) IsDisabled() bool
IsDisabled returns true if the button is disabled.
func (*FormButton) SetAlignment ¶
func (b *FormButton) SetAlignment(alignment ButtonAlignment) *FormButton
SetAlignment sets the button's alignment within its container.
func (*FormButton) SetCustomPosition ¶
func (b *FormButton) SetCustomPosition(x, y int) *FormButton
SetCustomPosition sets custom positioning for the button (only used when alignment is AlignCustom).
func (*FormButton) SetDisabled ¶
func (b *FormButton) SetDisabled(disabled bool) tview.FormItem
SetDisabled sets whether the button is disabled.
func (*FormButton) SetFieldWidth ¶
func (b *FormButton) SetFieldWidth(width int) tview.FormItem
SetFieldWidth is a no-op for FormButton.
func (*FormButton) SetFinishedFunc ¶
func (b *FormButton) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem
SetFinishedFunc sets the doneFunc for Tab/Backtab navigation.
func (*FormButton) SetFormAttributes ¶
func (b *FormButton) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem
SetFormAttributes is a no-op for FormButton (to satisfy tview.FormItem interface).
func (*FormButton) SetLabel ¶
func (b *FormButton) SetLabel(label string) tview.FormItem
SetLabel sets the button label.
func (*FormButton) SetSelectedFunc ¶
func (b *FormButton) SetSelectedFunc(handler func()) *FormButton
SetSelectedFunc sets the callback for when the button is pressed.
type GuestAction ¶ added in v1.0.9
type GuestAction struct {
ID string
Label string
Shortcut rune
Handler GuestActionHandler
IsAvailable func(node *api.Node, guest *api.VM) bool
}
GuestAction describes a menu action contributed by a plugin for guest targets (VMs and containers).
If Shortcut is zero, no keyboard shortcut is registered. When IsAvailable is nil the action is always shown for the selected guest.
type GuestActionHandler ¶ added in v1.0.9
GuestActionHandler executes a plugin-provided guest-level action.
Implementations receive the application instance along with the node and guest information, allowing access to both the host node and the specific VM/container.
type Header ¶
Header encapsulates the application header.
func (*Header) GetCurrentProfile ¶
GetCurrentProfile returns the currently connected profile name.
func (*Header) IsLoading ¶
IsLoading reports whether the header is currently showing a loading state.
func (*Header) SetApp ¶
func (h *Header) SetApp(app *tview.Application)
SetApp sets the application reference for UI updates.
func (*Header) ShowActiveProfile ¶
ShowActiveProfile displays the active profile in the header.
func (*Header) ShowLoading ¶
ShowLoading displays an animated loading indicator.
func (*Header) ShowSuccess ¶
ShowSuccess displays a success message temporarily.
func (*Header) ShowWarning ¶
ShowWarning displays a warning message temporarily.
func (*Header) StopLoading ¶
func (h *Header) StopLoading()
StopLoading stops the loading animation.
type HeaderComponent ¶
type HelpModal ¶
HelpModal represents a modal dialog showing keybindings and usage information.
func NewHelpModal ¶
func NewHelpModal(keys config.KeyBindings) *HelpModal
NewHelpModal creates a new help modal.
type NodeAction ¶ added in v1.0.7
type NodeAction struct {
ID string
Label string
Shortcut rune
Handler NodeActionHandler
IsAvailable func(node *api.Node) bool
}
NodeAction describes a menu action contributed by a plugin for node targets.
If Shortcut is zero, no keyboard shortcut is registered. When IsAvailable is nil the action is always shown for the selected node.
type NodeActionHandler ¶ added in v1.0.7
NodeActionHandler executes a plugin-provided node-level action.
Implementations receive the application instance along with the currently selected node and can leverage the shared application context for long-running operations.
type NodeDetails ¶
NodeDetails encapsulates the node details panel.
func NewNodeDetails ¶
func NewNodeDetails() *NodeDetails
NewNodeDetails creates a new node details panel.
func (*NodeDetails) Clear ¶
func (nd *NodeDetails) Clear() *tview.Table
Clear wraps the table Clear method to satisfy the interface.
func (*NodeDetails) SetApp ¶
func (nd *NodeDetails) SetApp(app *App)
SetApp sets the parent app reference for focus management.
type NodeDetailsComponent ¶
type NodeList ¶
NodeList encapsulates the node list panel.
func (*NodeList) GetSelectedNode ¶
GetSelectedNode returns the currently selected node.
func (*NodeList) SetCurrentItem ¶
SetCurrentItem wraps the list method to match the interface.
func (*NodeList) SetNodeChangedFunc ¶
SetNodeChangedFunc sets the function to be called when selection changes.
func (*NodeList) SetNodeSelectedFunc ¶
SetNodeSelectedFunc sets the function to be called when a node is selected.
type NodeListComponent ¶
type Plugin ¶ added in v1.0.7
type Plugin interface {
ID() string
Name() string
Description() string
Initialize(ctx context.Context, app *App, registrar PluginRegistrar) error
Shutdown(ctx context.Context) error
ModalPageNames() []string
}
Plugin defines the lifecycle hooks required to extend the UI through the plugin subsystem.
Initialize is called once during application startup. Shutdown is invoked as part of application teardown and should release any resources acquired by the plugin.
ModalPageNames returns a list of page names that this plugin adds to the application's page stack. These pages will be treated as modals by the global keyboard handler, preventing global keybindings from firing when they are active. Return an empty slice if the plugin doesn't add any modal pages.
type PluginInfo ¶ added in v1.0.7
PluginInfo describes user-facing metadata for a plugin.
type PluginRegistrar ¶ added in v1.0.7
type PluginRegistrar interface {
RegisterNodeAction(action NodeAction)
RegisterGuestAction(action GuestAction)
}
PluginRegistrar exposes registration hooks a plugin can use to contribute to the UI. It is provided to plugins during initialization.
type SnapshotForm ¶
type SnapshotForm struct {
// contains filtered or unexported fields
}
SnapshotForm manages the create snapshot form.
func NewSnapshotForm ¶
func NewSnapshotForm(app *App, vm *api.VM) *SnapshotForm
NewSnapshotForm creates a new snapshot form handler.
func (*SnapshotForm) ShowCreateForm ¶
func (sf *SnapshotForm) ShowCreateForm(onSuccess func())
ShowCreateForm displays the create snapshot form.
type SnapshotManager ¶
SnapshotManager manages the snapshot interface for VMs and containers.
func NewSnapshotManager ¶
func NewSnapshotManager(app *App, vm *api.VM) *SnapshotManager
NewSnapshotManager creates a new snapshot manager for the given VM.
type SnapshotOperations ¶
type SnapshotOperations struct {
// contains filtered or unexported fields
}
SnapshotOperations handles snapshot CRUD operations.
func NewSnapshotOperations ¶
func NewSnapshotOperations(app *App, vm *api.VM) *SnapshotOperations
NewSnapshotOperations creates a new snapshot operations handler.
func (*SnapshotOperations) CreateSnapshot ¶
func (so *SnapshotOperations) CreateSnapshot(name string, description string, vmState bool) error
CreateSnapshot creates a new snapshot with the given options.
func (*SnapshotOperations) DeleteSnapshot ¶
func (so *SnapshotOperations) DeleteSnapshot(snapshotName string) error
DeleteSnapshot deletes the specified snapshot.
func (*SnapshotOperations) GetSnapshots ¶
func (so *SnapshotOperations) GetSnapshots() ([]api.Snapshot, error)
GetSnapshots retrieves all snapshots for the VM.
func (*SnapshotOperations) RollbackToSnapshot ¶
func (so *SnapshotOperations) RollbackToSnapshot(snapshotName string) error
RollbackToSnapshot rolls back to the specified snapshot.
type SnapshotTable ¶
SnapshotTable manages the snapshot list display and selection.
func NewSnapshotTable ¶
func NewSnapshotTable(app *App, vm *api.VM) *SnapshotTable
NewSnapshotTable creates a new snapshot table.
func (*SnapshotTable) DisplaySnapshots ¶
func (st *SnapshotTable) DisplaySnapshots(snapshots []api.Snapshot)
DisplaySnapshots displays the snapshots in the table.
func (*SnapshotTable) GetSelectedSnapshot ¶
func (st *SnapshotTable) GetSelectedSnapshot() *api.Snapshot
GetSelectedSnapshot gets the currently selected snapshot.
func (*SnapshotTable) GetSnapshotCount ¶
func (st *SnapshotTable) GetSnapshotCount() int
GetSnapshotCount returns the count of real snapshots (excluding "current").
type TasksList ¶
TasksList encapsulates the tasks list panel.
func (*TasksList) GetSelectedTask ¶
func (tl *TasksList) GetSelectedTask() *api.ClusterTask
GetSelectedTask returns the currently selected task from history table.
func (*TasksList) Refresh ¶ added in v1.0.18
func (tl *TasksList) Refresh()
Refresh updates active tasks from TaskManager.
func (*TasksList) Select ¶
Select wraps the table Select method to match the interface. Delegates to history table.
func (*TasksList) SetFilteredTasks ¶
func (tl *TasksList) SetFilteredTasks(tasks []*api.ClusterTask)
SetFilteredTasks updates the tasks list with filtered data.
func (*TasksList) SetTasks ¶
func (tl *TasksList) SetTasks(tasks []*api.ClusterTask)
SetTasks updates the tasks list with new data.
type TasksListComponent ¶
type TasksListComponent interface {
tview.Primitive
SetApp(*App)
SetTasks([]*api.ClusterTask)
SetFilteredTasks([]*api.ClusterTask)
GetSelectedTask() *api.ClusterTask
Select(row, column int) *tview.Table
Clear() *tview.Table
Refresh()
}
type VMConfigPage ¶
VMConfigPage is a modal/page for editing VM or LXC configuration.
type VMDetails ¶
VMDetails encapsulates the VM details panel.
type VMDetailsComponent ¶
type VMList ¶
VMList encapsulates the VM list panel.
func (*VMList) GetNodeForVM ¶ added in v1.0.9
GetNodeForVM returns the node object for a given VM by looking it up from the app's node list.
func (*VMList) GetSelectedVM ¶
GetSelectedVM returns the currently selected VM.
func (*VMList) SetCurrentItem ¶
SetCurrentItem wraps the list method to match the interface.
func (*VMList) SetVMChangedFunc ¶
SetVMChangedFunc sets the function to be called when selection changes.
func (*VMList) SetVMSelectedFunc ¶
SetVMSelectedFunc sets the function to be called when a VM is selected.
type VMListComponent ¶
type WideModal ¶ added in v1.0.14
WideModal is a slightly modified version of tview.Modal that allows controlling the minimum width and the fraction of screen width used for layout. This prevents long lines (e.g., URLs) from wrapping unexpectedly.
func NewWideModal ¶ added in v1.0.14
NewWideModal creates a modal that uses the provided widthRatio (0 < ratio <= 1) of the available screen width and enforces a minimum inner width.
func (*WideModal) AddButtons ¶ added in v1.0.14
AddButtons adds buttons to the window.
func (*WideModal) ClearButtons ¶ added in v1.0.14
ClearButtons removes all buttons from the window.
func (*WideModal) HasFocus ¶ added in v1.0.14
HasFocus returns whether or not this primitive has focus.
func (*WideModal) InputHandler ¶ added in v1.0.14
InputHandler forwards key events to the embedded form so buttons work.
func (*WideModal) MouseHandler ¶ added in v1.0.14
func (m *WideModal) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)
MouseHandler returns the mouse handler for this primitive.
func (*WideModal) SetBackgroundColor ¶ added in v1.0.14
SetBackgroundColor sets the color of the modal frame background.
func (*WideModal) SetButtonActivatedStyle ¶ added in v1.0.14
SetButtonActivatedStyle sets the style of the buttons when they are focused.
func (*WideModal) SetButtonBackgroundColor ¶ added in v1.0.14
SetButtonBackgroundColor sets the background color of the buttons.
func (*WideModal) SetButtonStyle ¶ added in v1.0.14
SetButtonStyle sets the style of the buttons when they are not focused.
func (*WideModal) SetButtonTextColor ¶ added in v1.0.14
SetButtonTextColor sets the color of the button texts.
func (*WideModal) SetDoneFunc ¶ added in v1.0.14
SetDoneFunc sets a handler which is called when one of the buttons was pressed.
func (*WideModal) SetFocus ¶ added in v1.0.14
SetFocus shifts the focus to the button with the given index.
type WizardResult ¶
WizardResult represents the result of a configuration wizard operation.
func LaunchConfigWizard ¶
func LaunchConfigWizard(cfg *config.Config, configPath string, activeProfile string) WizardResult
LaunchConfigWizard launches the configuration wizard and returns the result.
Source Files
¶
- app.go
- app_lifecycle.go
- auto_refresh.go
- auto_refresh_execution.go
- backup_form.go
- backup_operations.go
- backup_table.go
- cluster_status.go
- config_wizard.go
- connection_profiles.go
- connection_profiles_operations.go
- context_menu.go
- dialogs.go
- dialogs_creators.go
- footer.go
- form_button.go
- form_helpers.go
- global_menu.go
- header.go
- help_modal.go
- interfaces.go
- keyboard.go
- layout.go
- node_details.go
- node_list.go
- node_menu.go
- plugins.go
- plugins_manager.go
- profile_wizard.go
- refresh.go
- refresh_vm.go
- search.go
- selection.go
- shell.go
- snapshot_form.go
- snapshot_operations.go
- snapshot_table.go
- tasks_list.go
- tasks_list_formatting.go
- vim_nav.go
- vm_backups.go
- vm_config.go
- vm_details.go
- vm_details_network.go
- vm_details_utils.go
- vm_list.go
- vm_menu.go
- vm_migration.go
- vm_operations.go
- vm_selection.go
- vm_snapshots.go
- vm_types.go
- vnc.go
- wide_modal.go