tui

package
v0.0.0-...-7e90525 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 12 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 {
	// contains filtered or unexported fields
}

App encapsulates the entire TUI application, including its state and components. It holds references to all UI views and manages the application's data state.

func NewApp

func NewApp() *App

NewApp creates and initializes a new Lazynet application.

func (*App) Run

func (a *App) Run() error

Run starts the TUI application and the main data refresh loop.

func (*App) Stop

func (a *App) Stop()

Stop gracefully shuts down the application.

type AppState

type AppState struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

AppState holds the dynamic data and UI state of the application. It uses a mutex to ensure thread-safe access from different goroutines.

func NewAppState

func NewAppState() *AppState

NewAppState creates and initializes a new AppState.

func (*AppState) CycleSortColumn

func (s *AppState) CycleSortColumn()

CycleSortColumn moves to the next sortable column.

func (*AppState) GetFilteredConnections

func (s *AppState) GetFilteredConnections() []models.Connection

GetFilteredConnections returns the currently visible list of connections.

func (*AppState) SetConnections

func (s *AppState) SetConnections(conns []models.Connection)

SetConnections updates the master list of connections and reapplies sorting and filtering.

func (*AppState) SetFilterText

func (s *AppState) SetFilterText(text string)

SetFilterText updates the filter query and reapplies it.

func (*AppState) SetSort

func (s *AppState) SetSort(column int, asc bool)

SetSort changes the sorting parameters and reapplies sorting.

func (*AppState) ToggleSortOrder

func (s *AppState) ToggleSortOrder()

ToggleSortOrder reverses the current sort order.

type View

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

View represents the main UI of the application. It holds all the tview components.

func NewView

func NewView(app *App) *View

func (*View) GetSelectedConnection

func (v *View) GetSelectedConnection() *models.Connection

GetSelectedConnection returns the connection object for the currently selected row in the table.

func (*View) Init

func (v *View) Init()

Init sets up the layout and makes the view visible.

func (*View) Refresh

func (v *View) Refresh()

Refresh re-draws the main table and details view with the latest data from the app state.

func (*View) SetStatusMessage

func (v *View) SetStatusMessage(message string)

SetStatusMessage updates the hint view with a temporary message.

func (*View) ShowInfoModal

func (v *View) ShowInfoModal(message string, duration int)

ShowInfoModal displays a short-lived informational message to the user.

Jump to

Keyboard shortcuts

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