Documentation
¶
Overview ¶
Package components provides reusable UI components for the s9s interface.
Index ¶
- type Alert
- type AlertLevel
- type AlertNotifier
- type AlertsBadge
- type AlertsManager
- func (am *AlertsManager) AcknowledgeAlert(id string)
- func (am *AlertsManager) AddAlert(alert *Alert)
- func (am *AlertsManager) CheckClusterHealth(health *monitoring.ClusterHealth)
- func (am *AlertsManager) ClearAllAlerts()
- func (am *AlertsManager) DismissAlert(id string)
- func (am *AlertsManager) GetAlerts() []*Alert
- func (am *AlertsManager) GetUnacknowledgedAlerts() []*Alert
- func (am *AlertsManager) OnAlert(listener func(*Alert))
- func (am *AlertsManager) SetNotifier(notifier AlertNotifier)
- type AlertsView
- type Column
- type ColumnBuilder
- type FilterBar
- func (fb *FilterBar) GetCurrentFilter() *filters.Filter
- func (fb *FilterBar) Hide()
- func (fb *FilterBar) SetFilter(filterStr string)
- func (fb *FilterBar) SetOnClose(handler func())
- func (fb *FilterBar) SetOnFilterChange(handler func(filter *filters.Filter))
- func (fb *FilterBar) SetPages(pages *tview.Pages)
- func (fb *FilterBar) Show()
- func (fb *FilterBar) ShowFilterHelp()
- type Header
- type LoadingIndicator
- type LoadingManager
- type LoadingWrapper
- type MultiPaneManager
- func (mpm *MultiPaneManager) AddPane(pane *Pane) error
- func (mpm *MultiPaneManager) Close()
- func (mpm *MultiPaneManager) CloseActivePane()
- func (mpm *MultiPaneManager) GetActivePane() *Pane
- func (mpm *MultiPaneManager) GetContainer() *tview.Flex
- func (mpm *MultiPaneManager) GetPane(id string) *Pane
- func (mpm *MultiPaneManager) GetPaneCount() int
- func (mpm *MultiPaneManager) NewPane(id, title string, paneType PaneType, content tview.Primitive) error
- func (mpm *MultiPaneManager) NextPane()
- func (mpm *MultiPaneManager) PreviousPane()
- func (mpm *MultiPaneManager) RemovePane(id string) error
- func (mpm *MultiPaneManager) RenameActivePane()
- func (mpm *MultiPaneManager) SetLayout(layout PaneLayout)
- func (mpm *MultiPaneManager) SetOnLayoutChange(callback func(PaneLayout))
- func (mpm *MultiPaneManager) SetOnPaneSwitch(callback func(oldPane, newPane string))
- func (mpm *MultiPaneManager) SplitHorizontal()
- func (mpm *MultiPaneManager) SplitVertical()
- func (mpm *MultiPaneManager) SwitchToPane(index int)
- func (mpm *MultiPaneManager) ToggleFullscreen()
- func (mpm *MultiPaneManager) ToggleNavMode()
- type MultiSelectTable
- func (mst *MultiSelectTable) ClearSelection()
- func (mst *MultiSelectTable) GetAllSelectedData() [][]string
- func (mst *MultiSelectTable) GetCurrentRowData() []string
- func (mst *MultiSelectTable) GetMultiSelectHints() []string
- func (mst *MultiSelectTable) GetSelectedData() []string
- func (mst *MultiSelectTable) GetSelectedRows() []int
- func (mst *MultiSelectTable) GetSelectionCount() int
- func (mst *MultiSelectTable) InvertSelection()
- func (mst *MultiSelectTable) IsMultiSelectMode() bool
- func (mst *MultiSelectTable) IsRowSelected(row int) bool
- func (mst *MultiSelectTable) SelectAll()
- func (mst *MultiSelectTable) SetData(data [][]string)
- func (mst *MultiSelectTable) SetMultiSelectMode(enabled bool)
- func (mst *MultiSelectTable) SetOnRowToggle(callback func(row int, selected bool, data []string))
- func (mst *MultiSelectTable) SetOnSelectionChange(callback func(selectedCount int, allSelected bool))
- func (mst *MultiSelectTable) SetShowCheckboxes(show bool)
- func (mst *MultiSelectTable) ToggleRow(row int)
- type Pane
- type PaneLayout
- type PaneType
- type PresetManagerUI
- type StatusBar
- func (s *StatusBar) ClearMessage()
- func (s *StatusBar) Error(message string)
- func (s *StatusBar) Flash(message string, color tcell.Color, duration time.Duration)
- func (s *StatusBar) Info(message string)
- func (s *StatusBar) SetHints(hints []string)
- func (s *StatusBar) SetMessage(message string, duration time.Duration)
- func (s *StatusBar) Success(message string)
- func (s *StatusBar) Warning(message string)
- type StatusBarBuilder
- type StatusLevel
- type StatusMessage
- type Table
- func (t *Table) Clear()
- func (t *Table) Draw(screen tcell.Screen)
- func (t *Table) GetCurrentSortColumn() (column int, ascending bool)
- func (t *Table) GetData() [][]string
- func (t *Table) GetFilter() string
- func (t *Table) GetFilteredData() [][]string
- func (t *Table) GetSelectedData() []string
- func (t *Table) GetSelectedRow() int
- func (t *Table) GetSortableColumns() []struct{ ... }
- func (t *Table) SetColumns(columns []Column)
- func (t *Table) SetData(data [][]string)
- func (t *Table) SetFilter(filter string)
- func (t *Table) SetOnSelect(fn func(row, col int))
- func (t *Table) SetOnSort(fn func(col int, ascending bool))
- func (t *Table) SetSortColumn(column int)
- func (t *Table) Sort(column int)
- type TableBuilder
- func (tb *TableBuilder) Build() *Table
- func (tb *TableBuilder) WithColors(selected, header, border tcell.Color) *TableBuilder
- func (tb *TableBuilder) WithColumns(columns ...Column) *TableBuilder
- func (tb *TableBuilder) WithHeader(show bool) *TableBuilder
- func (tb *TableBuilder) WithSelectable(selectable bool) *TableBuilder
- type TableConfig
- type TerminalPane
- func (tp *TerminalPane) Close() error
- func (tp *TerminalPane) GetCommandHistory() []string
- func (tp *TerminalPane) GetContainer() tview.Primitive
- func (tp *TerminalPane) GetHostname() string
- func (tp *TerminalPane) GetID() string
- func (tp *TerminalPane) GetLastActivity() time.Time
- func (tp *TerminalPane) GetUsername() string
- func (tp *TerminalPane) IsConnected() bool
- func (tp *TerminalPane) SendCommand(command string) error
- func (tp *TerminalPane) SetOnClose(callback func(string) error)
- func (tp *TerminalPane) SetOnTitleChange(callback func(string, string))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
ID string
Level AlertLevel
Title string
Message string
Source string // e.g., "nodes", "jobs", "cluster"
Timestamp time.Time
Acknowledged bool
AutoDismiss bool
DismissAfter time.Duration
}
Alert represents a system alert
type AlertLevel ¶
type AlertLevel int
AlertLevel represents the severity of an alert
const ( // AlertInfo is the info alert level. AlertInfo AlertLevel = iota // AlertWarning is the warning alert level. AlertWarning // AlertError is the error alert level. AlertError // AlertCritical is the critical alert level. AlertCritical )
type AlertNotifier ¶
type AlertNotifier interface {
Notify(alert *Alert)
}
AlertNotifier is an interface for sending alert notifications
type AlertsBadge ¶
type AlertsBadge struct {
// contains filtered or unexported fields
}
AlertsBadge displays a small alert count badge
func NewAlertsBadge ¶
func NewAlertsBadge(manager *AlertsManager) *AlertsBadge
NewAlertsBadge creates a new alerts badge
func (*AlertsBadge) GetView ¶
func (ab *AlertsBadge) GetView() tview.Primitive
GetView returns the badge component
type AlertsManager ¶
type AlertsManager struct {
// contains filtered or unexported fields
}
AlertsManager manages system alerts
func NewAlertsManager ¶
func NewAlertsManager(maxAlerts int) *AlertsManager
NewAlertsManager creates a new alerts manager
func (*AlertsManager) AcknowledgeAlert ¶
func (am *AlertsManager) AcknowledgeAlert(id string)
AcknowledgeAlert marks an alert as acknowledged
func (*AlertsManager) AddAlert ¶
func (am *AlertsManager) AddAlert(alert *Alert)
AddAlert adds a new alert
func (*AlertsManager) CheckClusterHealth ¶
func (am *AlertsManager) CheckClusterHealth(health *monitoring.ClusterHealth)
CheckClusterHealth generates alerts based on cluster health
func (*AlertsManager) ClearAllAlerts ¶
func (am *AlertsManager) ClearAllAlerts()
ClearAllAlerts removes all alerts
func (*AlertsManager) DismissAlert ¶
func (am *AlertsManager) DismissAlert(id string)
DismissAlert removes an alert
func (*AlertsManager) GetAlerts ¶
func (am *AlertsManager) GetAlerts() []*Alert
GetAlerts returns all current alerts
func (*AlertsManager) GetUnacknowledgedAlerts ¶
func (am *AlertsManager) GetUnacknowledgedAlerts() []*Alert
GetUnacknowledgedAlerts returns only unacknowledged alerts
func (*AlertsManager) OnAlert ¶
func (am *AlertsManager) OnAlert(listener func(*Alert))
OnAlert registers a listener for new alerts
func (*AlertsManager) SetNotifier ¶
func (am *AlertsManager) SetNotifier(notifier AlertNotifier)
SetNotifier sets the alert notifier
type AlertsView ¶
type AlertsView struct {
// contains filtered or unexported fields
}
AlertsView displays alerts in a modal
func NewAlertsView ¶
func NewAlertsView(manager *AlertsManager, app *tview.Application) *AlertsView
NewAlertsView creates a new alerts view
func (*AlertsView) GetView ¶
func (av *AlertsView) GetView() tview.Primitive
GetView returns the alerts view component
func (*AlertsView) SetKeyHandler ¶
func (av *AlertsView) SetKeyHandler()
SetKeyHandler sets up keyboard shortcuts
func (*AlertsView) SetNotificationManager ¶
func (av *AlertsView) SetNotificationManager(mgr interface{})
SetNotificationManager sets the notification manager reference
func (*AlertsView) SetPages ¶
func (av *AlertsView) SetPages(pages *tview.Pages)
SetPages sets the pages reference for modal navigation
type Column ¶
type Column struct {
Name string
Width int
Alignment int // 0=left, 1=center, 2=right
Sortable bool
Hidden bool
}
Column represents a table column definition
type ColumnBuilder ¶
type ColumnBuilder struct {
// contains filtered or unexported fields
}
ColumnBuilder provides a fluent interface for building columns
func (*ColumnBuilder) Align ¶
func (cb *ColumnBuilder) Align(alignment int) *ColumnBuilder
Align sets the column alignment
func (*ColumnBuilder) Hidden ¶
func (cb *ColumnBuilder) Hidden(hidden bool) *ColumnBuilder
Hidden sets whether the column is hidden
func (*ColumnBuilder) Sortable ¶
func (cb *ColumnBuilder) Sortable(sortable bool) *ColumnBuilder
Sortable sets whether the column is sortable
func (*ColumnBuilder) Width ¶
func (cb *ColumnBuilder) Width(width int) *ColumnBuilder
Width sets the column width
type FilterBar ¶
FilterBar provides an advanced filtering interface
func NewFilterBar ¶
func NewFilterBar(viewType string, app *tview.Application) *FilterBar
NewFilterBar creates a new filter bar component
func (*FilterBar) GetCurrentFilter ¶
GetCurrentFilter returns the current filter
func (*FilterBar) SetOnClose ¶
func (fb *FilterBar) SetOnClose(handler func())
SetOnClose sets the callback for closing the filter bar
func (*FilterBar) SetOnFilterChange ¶
SetOnFilterChange sets the callback for filter changes
func (*FilterBar) ShowFilterHelp ¶
func (fb *FilterBar) ShowFilterHelp()
ShowFilterHelp shows detailed filter help
type Header ¶
Header displays cluster status and navigation information
func (*Header) SetAlertsBadge ¶
func (h *Header) SetAlertsBadge(badge *AlertsBadge)
SetAlertsBadge sets the alerts badge for display in the header
func (*Header) SetClusterInfo ¶
func (h *Header) SetClusterInfo(info *dao.ClusterInfo)
SetClusterInfo sets the cluster information
func (*Header) SetCurrentView ¶
SetCurrentView sets the current active view
func (*Header) SetMetrics ¶
func (h *Header) SetMetrics(metrics *dao.ClusterMetrics)
SetMetrics sets the cluster metrics
type LoadingIndicator ¶
LoadingIndicator shows a loading spinner and message
func NewLoadingIndicator ¶
func NewLoadingIndicator(app *tview.Application) *LoadingIndicator
NewLoadingIndicator creates a new loading indicator
func (*LoadingIndicator) Hide ¶
func (li *LoadingIndicator) Hide()
Hide stops and hides the loading indicator
func (*LoadingIndicator) IsActive ¶
func (li *LoadingIndicator) IsActive() bool
IsActive returns true if the loading indicator is currently active
func (*LoadingIndicator) SetMessage ¶
func (li *LoadingIndicator) SetMessage(message string)
SetMessage updates the loading message
func (*LoadingIndicator) Show ¶
func (li *LoadingIndicator) Show(message string)
Show displays the loading indicator with the given message
type LoadingManager ¶
type LoadingManager struct {
// contains filtered or unexported fields
}
LoadingManager manages loading indicators across views
func NewLoadingManager ¶
func NewLoadingManager(app *tview.Application, pages *tview.Pages) *LoadingManager
NewLoadingManager creates a new loading manager
func (*LoadingManager) Hide ¶
func (lm *LoadingManager) Hide(viewName string)
Hide hides the loading indicator for the given view
func (*LoadingManager) IsActive ¶
func (lm *LoadingManager) IsActive(viewName string) bool
IsActive returns true if loading is active for the given view
func (*LoadingManager) SetMessage ¶
func (lm *LoadingManager) SetMessage(viewName, message string)
SetMessage updates the loading message for a view
func (*LoadingManager) Show ¶
func (lm *LoadingManager) Show(viewName, message string)
Show displays a loading indicator for the given view
type LoadingWrapper ¶
type LoadingWrapper struct {
// contains filtered or unexported fields
}
LoadingWrapper provides a convenient way to wrap operations with loading indicators
func NewLoadingWrapper ¶
func NewLoadingWrapper(manager *LoadingManager, viewName string) *LoadingWrapper
NewLoadingWrapper creates a new loading wrapper for a specific view
func (*LoadingWrapper) UpdateMessage ¶
func (lw *LoadingWrapper) UpdateMessage(message string)
UpdateMessage updates the loading message
func (*LoadingWrapper) WithLoading ¶
func (lw *LoadingWrapper) WithLoading(message string, fn func() error) error
WithLoading executes the given function with a loading indicator
func (*LoadingWrapper) WithLoadingAsync ¶
func (lw *LoadingWrapper) WithLoadingAsync(message string, fn func() error, callback func(error))
WithLoadingAsync executes the given function asynchronously with a loading indicator
type MultiPaneManager ¶
type MultiPaneManager struct {
// contains filtered or unexported fields
}
MultiPaneManager manages multiple panes in a flexible layout
func NewMultiPaneManager ¶
func NewMultiPaneManager(app *tview.Application) *MultiPaneManager
NewMultiPaneManager creates a new multi-pane manager
func (*MultiPaneManager) AddPane ¶
func (mpm *MultiPaneManager) AddPane(pane *Pane) error
AddPane adds a new pane to the manager
func (*MultiPaneManager) Close ¶
func (mpm *MultiPaneManager) Close()
Close closes all panes and cleans up resources
func (*MultiPaneManager) CloseActivePane ¶
func (mpm *MultiPaneManager) CloseActivePane()
CloseActivePane closes the currently active pane
func (*MultiPaneManager) GetActivePane ¶
func (mpm *MultiPaneManager) GetActivePane() *Pane
GetActivePane returns the currently active pane
func (*MultiPaneManager) GetContainer ¶
func (mpm *MultiPaneManager) GetContainer() *tview.Flex
GetContainer returns the main container
func (*MultiPaneManager) GetPane ¶
func (mpm *MultiPaneManager) GetPane(id string) *Pane
GetPane returns a specific pane by ID
func (*MultiPaneManager) GetPaneCount ¶
func (mpm *MultiPaneManager) GetPaneCount() int
GetPaneCount returns the number of open panes
func (*MultiPaneManager) NewPane ¶
func (mpm *MultiPaneManager) NewPane(id, title string, paneType PaneType, content tview.Primitive) error
NewPane creates and adds a new pane
func (*MultiPaneManager) NextPane ¶
func (mpm *MultiPaneManager) NextPane()
NextPane switches to the next pane
func (*MultiPaneManager) PreviousPane ¶
func (mpm *MultiPaneManager) PreviousPane()
PreviousPane switches to the previous pane
func (*MultiPaneManager) RemovePane ¶
func (mpm *MultiPaneManager) RemovePane(id string) error
RemovePane removes a pane from the manager
func (*MultiPaneManager) RenameActivePane ¶
func (mpm *MultiPaneManager) RenameActivePane()
RenameActivePane allows renaming the active pane
func (*MultiPaneManager) SetLayout ¶
func (mpm *MultiPaneManager) SetLayout(layout PaneLayout)
SetLayout changes the pane layout
func (*MultiPaneManager) SetOnLayoutChange ¶
func (mpm *MultiPaneManager) SetOnLayoutChange(callback func(PaneLayout))
SetOnLayoutChange sets the callback for layout changes
func (*MultiPaneManager) SetOnPaneSwitch ¶
func (mpm *MultiPaneManager) SetOnPaneSwitch(callback func(oldPane, newPane string))
SetOnPaneSwitch sets the callback for pane switching
func (*MultiPaneManager) SplitHorizontal ¶
func (mpm *MultiPaneManager) SplitHorizontal()
SplitHorizontal splits the current pane horizontally
func (*MultiPaneManager) SplitVertical ¶
func (mpm *MultiPaneManager) SplitVertical()
SplitVertical splits the current pane vertically
func (*MultiPaneManager) SwitchToPane ¶
func (mpm *MultiPaneManager) SwitchToPane(index int)
SwitchToPane switches to a pane by index
func (*MultiPaneManager) ToggleFullscreen ¶
func (mpm *MultiPaneManager) ToggleFullscreen()
ToggleFullscreen toggles fullscreen mode for the active pane
func (*MultiPaneManager) ToggleNavMode ¶
func (mpm *MultiPaneManager) ToggleNavMode()
ToggleNavMode toggles navigation mode for keyboard shortcuts
type MultiSelectTable ¶
type MultiSelectTable struct {
*Table
// contains filtered or unexported fields
}
MultiSelectTable extends the regular table with multi-select capabilities
func NewMultiSelectTable ¶
func NewMultiSelectTable(config *TableConfig) *MultiSelectTable
NewMultiSelectTable creates a new multi-select table
func (*MultiSelectTable) ClearSelection ¶
func (mst *MultiSelectTable) ClearSelection()
ClearSelection clears all selections
func (*MultiSelectTable) GetAllSelectedData ¶
func (mst *MultiSelectTable) GetAllSelectedData() [][]string
GetAllSelectedData returns the data for all selected rows
func (*MultiSelectTable) GetCurrentRowData ¶
func (mst *MultiSelectTable) GetCurrentRowData() []string
GetCurrentRowData returns the data for the currently highlighted row (maintains compatibility)
func (*MultiSelectTable) GetMultiSelectHints ¶
func (mst *MultiSelectTable) GetMultiSelectHints() []string
GetMultiSelectHints returns keyboard hints for multi-select mode
func (*MultiSelectTable) GetSelectedData ¶
func (mst *MultiSelectTable) GetSelectedData() []string
GetSelectedData returns the data for selected rows (multi-select mode) or current row (single mode)
func (*MultiSelectTable) GetSelectedRows ¶
func (mst *MultiSelectTable) GetSelectedRows() []int
GetSelectedRows returns the selected row indices
func (*MultiSelectTable) GetSelectionCount ¶
func (mst *MultiSelectTable) GetSelectionCount() int
GetSelectionCount returns the number of selected rows
func (*MultiSelectTable) InvertSelection ¶
func (mst *MultiSelectTable) InvertSelection()
InvertSelection inverts the current selection
func (*MultiSelectTable) IsMultiSelectMode ¶
func (mst *MultiSelectTable) IsMultiSelectMode() bool
IsMultiSelectMode returns whether multi-select mode is enabled
func (*MultiSelectTable) IsRowSelected ¶
func (mst *MultiSelectTable) IsRowSelected(row int) bool
IsRowSelected returns whether a row is selected
func (*MultiSelectTable) SelectAll ¶
func (mst *MultiSelectTable) SelectAll()
SelectAll selects all visible rows
func (*MultiSelectTable) SetData ¶
func (mst *MultiSelectTable) SetData(data [][]string)
SetData sets the table data and maintains selections when data changes.
func (*MultiSelectTable) SetMultiSelectMode ¶
func (mst *MultiSelectTable) SetMultiSelectMode(enabled bool)
SetMultiSelectMode enables or disables multi-select mode
func (*MultiSelectTable) SetOnRowToggle ¶
func (mst *MultiSelectTable) SetOnRowToggle(callback func(row int, selected bool, data []string))
SetOnRowToggle sets callback for individual row toggle events
func (*MultiSelectTable) SetOnSelectionChange ¶
func (mst *MultiSelectTable) SetOnSelectionChange(callback func(selectedCount int, allSelected bool))
SetOnSelectionChange sets callback for selection changes
func (*MultiSelectTable) SetShowCheckboxes ¶
func (mst *MultiSelectTable) SetShowCheckboxes(show bool)
SetShowCheckboxes controls whether to show selection checkboxes
func (*MultiSelectTable) ToggleRow ¶
func (mst *MultiSelectTable) ToggleRow(row int)
ToggleRow toggles the selection state of a row
type Pane ¶
type Pane struct {
ID string
Title string
Type PaneType
Content tview.Primitive
Active bool
Closable bool
Resizable bool
MinWidth int
MinHeight int
LastFocus time.Time
Metadata map[string]interface{}
OnClose func(string) error
OnActivate func(string)
OnResize func(string, int, int)
}
Pane represents a single pane in the multi-pane interface
type PaneLayout ¶
type PaneLayout string
PaneLayout defines how panes are arranged
const ( // LayoutHorizontal is the horizontal pane layout. LayoutHorizontal PaneLayout = "horizontal" // LayoutVertical is the vertical pane layout. LayoutVertical PaneLayout = "vertical" // LayoutGrid is the grid pane layout. LayoutGrid PaneLayout = "grid" // LayoutTabs is the tabs pane layout. LayoutTabs PaneLayout = "tabs" )
type PaneType ¶
type PaneType string
PaneType defines the type of content in a pane
const ( // PaneTypeView is the pane type for view content. PaneTypeView PaneType = "view" // PaneTypeTerminal is the pane type for terminal content. PaneTypeTerminal PaneType = "terminal" // PaneTypeLog is the pane type for log content. PaneTypeLog PaneType = "log" // PaneTypeMonitor is the pane type for monitor content. PaneTypeMonitor PaneType = "monitor" // PaneTypeEditor is the pane type for editor content. PaneTypeEditor PaneType = "editor" )
type PresetManagerUI ¶
type PresetManagerUI struct {
// contains filtered or unexported fields
}
PresetManagerUI provides a UI for managing filter presets
func NewPresetManagerUI ¶
func NewPresetManagerUI(app *tview.Application, presetManager *filters.PresetManager, viewType string) *PresetManagerUI
NewPresetManagerUI creates a new preset manager UI
func (*PresetManagerUI) Show ¶
func (pm *PresetManagerUI) Show(pages *tview.Pages, onDone func())
Show displays the preset management interface
type StatusBar ¶
StatusBar displays status information and keyboard hints
func (*StatusBar) ClearMessage ¶
func (s *StatusBar) ClearMessage()
ClearMessage clears the current message
func (*StatusBar) SetMessage ¶
SetMessage sets a temporary message with optional expiry
type StatusBarBuilder ¶
type StatusBarBuilder struct {
// contains filtered or unexported fields
}
StatusBarBuilder provides a fluent interface for building status bars
func NewStatusBarBuilder ¶
func NewStatusBarBuilder() *StatusBarBuilder
NewStatusBarBuilder creates a new status bar builder
func (*StatusBarBuilder) Build ¶
func (sb *StatusBarBuilder) Build() *StatusBar
Build returns the status bar
func (*StatusBarBuilder) WithBackground ¶
func (sb *StatusBarBuilder) WithBackground(color tcell.Color) *StatusBarBuilder
WithBackground sets the background color
func (*StatusBarBuilder) WithHints ¶
func (sb *StatusBarBuilder) WithHints(hints ...string) *StatusBarBuilder
WithHints sets the keyboard hints
func (*StatusBarBuilder) WithTextColor ¶
func (sb *StatusBarBuilder) WithTextColor(color tcell.Color) *StatusBarBuilder
WithTextColor sets the text color
type StatusLevel ¶
type StatusLevel int
StatusLevel represents the level of a status message
const ( // StatusLevelInfo is the info status level. StatusLevelInfo StatusLevel = iota // StatusLevelSuccess is the success status level. StatusLevelSuccess // StatusLevelWarning is the warning status level. StatusLevelWarning // StatusLevelError is the error status level. StatusLevelError )
type StatusMessage ¶
type StatusMessage struct {
Text string
Level StatusLevel
Timestamp time.Time
Duration time.Duration
}
StatusMessage represents a status message with metadata
func NewStatusMessage ¶
func NewStatusMessage(text string, level StatusLevel, duration time.Duration) *StatusMessage
NewStatusMessage creates a new status message
func (*StatusMessage) Format ¶
func (sm *StatusMessage) Format() string
Format formats the message for display
func (*StatusMessage) GetColor ¶
func (sm *StatusMessage) GetColor() tcell.Color
GetColor returns the color for this message level
func (*StatusMessage) GetIcon ¶
func (sm *StatusMessage) GetIcon() string
GetIcon returns the icon for this message level
func (*StatusMessage) IsExpired ¶
func (sm *StatusMessage) IsExpired() bool
IsExpired checks if the message has expired
type Table ¶
Table is a reusable table component with sorting and filtering
func (*Table) GetCurrentSortColumn ¶ added in v0.4.0
GetCurrentSortColumn returns the current sort column index and direction
func (*Table) GetFilteredData ¶
GetFilteredData returns the filtered table data
func (*Table) GetSelectedData ¶
GetSelectedData returns the data for the currently selected row
func (*Table) GetSelectedRow ¶
GetSelectedRow returns the currently selected row index
func (*Table) GetSortableColumns ¶ added in v0.4.0
GetSortableColumns returns a list of sortable column names with their indices
func (*Table) SetColumns ¶
SetColumns sets the table columns
func (*Table) SetOnSelect ¶
SetOnSelect sets the selection callback
func (*Table) SetSortColumn ¶ added in v0.4.0
SetSortColumn programmatically sets the sort column (like clicking the header)
type TableBuilder ¶
type TableBuilder struct {
// contains filtered or unexported fields
}
TableBuilder provides a fluent interface for building tables
func NewTableBuilder ¶
func NewTableBuilder() *TableBuilder
NewTableBuilder creates a new table builder
func (*TableBuilder) WithColors ¶
func (tb *TableBuilder) WithColors(selected, header, border tcell.Color) *TableBuilder
WithColors sets the table colors
func (*TableBuilder) WithColumns ¶
func (tb *TableBuilder) WithColumns(columns ...Column) *TableBuilder
WithColumns sets the columns
func (*TableBuilder) WithHeader ¶
func (tb *TableBuilder) WithHeader(show bool) *TableBuilder
WithHeader sets whether to show the header
func (*TableBuilder) WithSelectable ¶
func (tb *TableBuilder) WithSelectable(selectable bool) *TableBuilder
WithSelectable sets whether the table is selectable
type TableConfig ¶
type TableConfig struct {
Columns []Column
Selectable bool
Scrollable bool
FixedRows int // Number of header rows
ShowHeader bool
BorderColor tcell.Color
SelectedColor tcell.Color
HeaderColor tcell.Color
EvenRowColor tcell.Color
OddRowColor tcell.Color
}
TableConfig holds table configuration
func DefaultTableConfig ¶
func DefaultTableConfig() *TableConfig
DefaultTableConfig returns default table configuration
type TerminalPane ¶
type TerminalPane struct {
// contains filtered or unexported fields
}
TerminalPane represents an SSH terminal pane
func NewTerminalPane ¶
func NewTerminalPane(id, hostname, username string, sessionManager *ssh.SessionManager) *TerminalPane
NewTerminalPane creates a new terminal pane
func (*TerminalPane) GetCommandHistory ¶
func (tp *TerminalPane) GetCommandHistory() []string
GetCommandHistory returns the command history
func (*TerminalPane) GetContainer ¶
func (tp *TerminalPane) GetContainer() tview.Primitive
GetContainer returns the main container
func (*TerminalPane) GetHostname ¶
func (tp *TerminalPane) GetHostname() string
GetHostname returns the hostname
func (*TerminalPane) GetLastActivity ¶
func (tp *TerminalPane) GetLastActivity() time.Time
GetLastActivity returns the last activity time
func (*TerminalPane) GetUsername ¶
func (tp *TerminalPane) GetUsername() string
GetUsername returns the username
func (*TerminalPane) IsConnected ¶
func (tp *TerminalPane) IsConnected() bool
IsConnected returns the connection status
func (*TerminalPane) SendCommand ¶
func (tp *TerminalPane) SendCommand(command string) error
SendCommand sends a command to the terminal
func (*TerminalPane) SetOnClose ¶
func (tp *TerminalPane) SetOnClose(callback func(string) error)
SetOnClose sets the close callback
func (*TerminalPane) SetOnTitleChange ¶
func (tp *TerminalPane) SetOnTitleChange(callback func(string, string))
SetOnTitleChange sets the title change callback