components

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package components provides reusable UI components for the s9s interface.

Index

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 NewColumn

func NewColumn(name string) *ColumnBuilder

NewColumn creates a new column builder

func (*ColumnBuilder) Align

func (cb *ColumnBuilder) Align(alignment int) *ColumnBuilder

Align sets the column alignment

func (*ColumnBuilder) Build

func (cb *ColumnBuilder) Build() Column

Build returns the column

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

type FilterBar struct {
	*tview.Flex
	// contains filtered or unexported fields
}

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

func (fb *FilterBar) GetCurrentFilter() *filters.Filter

GetCurrentFilter returns the current filter

func (*FilterBar) Hide

func (fb *FilterBar) Hide()

Hide hides the filter bar and calls onClose

func (*FilterBar) SetFilter

func (fb *FilterBar) SetFilter(filterStr string)

SetFilter sets the current filter

func (*FilterBar) SetOnClose

func (fb *FilterBar) SetOnClose(handler func())

SetOnClose sets the callback for closing the filter bar

func (*FilterBar) SetOnFilterChange

func (fb *FilterBar) SetOnFilterChange(handler func(filter *filters.Filter))

SetOnFilterChange sets the callback for filter changes

func (*FilterBar) SetPages

func (fb *FilterBar) SetPages(pages *tview.Pages)

SetPages sets the pages reference for modal handling

func (*FilterBar) Show

func (fb *FilterBar) Show()

Show displays the filter bar

func (*FilterBar) ShowFilterHelp

func (fb *FilterBar) ShowFilterHelp()

ShowFilterHelp shows detailed filter help

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

Header displays cluster status and navigation information

func NewHeader

func NewHeader() *Header

NewHeader creates a new header component

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

func (h *Header) SetCurrentView(view string)

SetCurrentView sets the current active view

func (*Header) SetMetrics

func (h *Header) SetMetrics(metrics *dao.ClusterMetrics)

SetMetrics sets the cluster metrics

func (*Header) SetViews

func (h *Header) SetViews(views []string)

SetViews sets the available views for navigation display

func (*Header) Stop

func (h *Header) Stop()

Stop stops the header update ticker

type LoadingIndicator

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

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

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

StatusBar displays status information and keyboard hints

func NewStatusBar

func NewStatusBar() *StatusBar

NewStatusBar creates a new status bar component

func (*StatusBar) ClearMessage

func (s *StatusBar) ClearMessage()

ClearMessage clears the current message

func (*StatusBar) Error

func (s *StatusBar) Error(message string)

Error displays an error message

func (*StatusBar) Flash

func (s *StatusBar) Flash(message string, color tcell.Color, duration time.Duration)

Flash displays a temporary flash message with color

func (*StatusBar) Info

func (s *StatusBar) Info(message string)

Info displays an info message

func (*StatusBar) SetHints

func (s *StatusBar) SetHints(hints []string)

SetHints sets the keyboard hints to display

func (*StatusBar) SetMessage

func (s *StatusBar) SetMessage(message string, duration time.Duration)

SetMessage sets a temporary message with optional expiry

func (*StatusBar) Success

func (s *StatusBar) Success(message string)

Success displays a success message

func (*StatusBar) Warning

func (s *StatusBar) Warning(message string)

Warning displays a warning message

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

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

Table is a reusable table component with sorting and filtering

func NewTable

func NewTable(config *TableConfig) *Table

NewTable creates a new table component

func (*Table) Clear

func (t *Table) Clear()

Clear clears the table

func (*Table) Draw added in v0.3.0

func (t *Table) Draw(screen tcell.Screen)

Draw overrides the base Table Draw to add mutex protection

func (*Table) GetCurrentSortColumn added in v0.4.0

func (t *Table) GetCurrentSortColumn() (column int, ascending bool)

GetCurrentSortColumn returns the current sort column index and direction

func (*Table) GetData

func (t *Table) GetData() [][]string

GetData returns the current table data

func (*Table) GetFilter

func (t *Table) GetFilter() string

GetFilter returns the current filter

func (*Table) GetFilteredData

func (t *Table) GetFilteredData() [][]string

GetFilteredData returns the filtered table data

func (*Table) GetSelectedData

func (t *Table) GetSelectedData() []string

GetSelectedData returns the data for the currently selected row

func (*Table) GetSelectedRow

func (t *Table) GetSelectedRow() int

GetSelectedRow returns the currently selected row index

func (*Table) GetSortableColumns added in v0.4.0

func (t *Table) GetSortableColumns() []struct {
	Index int
	Name  string
}

GetSortableColumns returns a list of sortable column names with their indices

func (*Table) SetColumns

func (t *Table) SetColumns(columns []Column)

SetColumns sets the table columns

func (*Table) SetData

func (t *Table) SetData(data [][]string)

SetData sets the table data

func (*Table) SetFilter

func (t *Table) SetFilter(filter string)

SetFilter sets the filter string

func (*Table) SetOnSelect

func (t *Table) SetOnSelect(fn func(row, col int))

SetOnSelect sets the selection callback

func (*Table) SetOnSort

func (t *Table) SetOnSort(fn func(col int, ascending bool))

SetOnSort sets the sort callback

func (*Table) SetSortColumn added in v0.4.0

func (t *Table) SetSortColumn(column int)

SetSortColumn programmatically sets the sort column (like clicking the header)

func (*Table) Sort

func (t *Table) Sort(column int)

Sort sorts the table by the specified column

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) Build

func (tb *TableBuilder) Build() *Table

Build creates the table

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) Close

func (tp *TerminalPane) Close() error

Close closes the 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) GetID

func (tp *TerminalPane) GetID() string

GetID returns the pane ID

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

Jump to

Keyboard shortcuts

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