ui

package
v0.0.0-...-cee8b2a Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ToastRefreshMessage = " Refreshing... "

Variables

This section is empty.

Functions

func CreateCustomListView

func CreateCustomListView(properties ListViewBoxProperties) *tview.List

func CreateCustomShortCutsView

func CreateCustomShortCutsView(App *tview.Application, properties CustomShortCutProperties) *tview.Table

func CreateCustomTableView

func CreateCustomTableView(properties CustomTableViewProperties) *tview.Table

func CreateErrorModal

func CreateErrorModal(background tview.Primitive, message string, onDismiss func()) *tview.Pages

CreateErrorModal creates a centered modal that displays an error message with an OK button. It returns a Pages primitive that overlays the modal on top of the provided background. When the user presses OK or ESC, the onDismiss callback is called to restore the previous view.

func CreateInputForm

func CreateInputForm(properties InputFormProperties) *tview.Form

func CreateJsonTextViewer

func CreateJsonTextViewer(properties JsonViewerProperties) *tview.TextView

CreateJsonTextViewer creates a formatted text view for JSON data

func CreateJsonTreeViewer

func CreateJsonTreeViewer(properties JsonViewerProperties) *tview.TreeView

CreateJsonTreeViewer creates an interactive tree view for JSON data

func CreateModal

func CreateModal(properties ModalProperties, currentFlex *tview.Flex) *tview.Modal

func ShowLoadingAnimation

func ShowLoadingAnimation(app *tview.Application, background tview.Primitive, done <-chan struct{}, onDone func()) *tview.Pages

ShowLoadingAnimation displays a centered dialog overlay on top of the provided background with an animated "Loading" text that cycles dots (Loading, Loading ., Loading . ., Loading . . .) until the done channel is closed. Once done is signalled, onDone is called via QueueUpdateDraw to swap the view. Returns a tview.Pages primitive to use as body.

func ShowToast

func ShowToast(app *tview.Application, widget Boxed, message string)

ShowToast temporarily changes a widget's title to show a custom toast message, then restores the original title after a short delay.

func ShowToastOnList

func ShowToastOnList(app *tview.Application, list *tview.List)

ShowToastOnList temporarily changes a list's title to show a toast message, then restores the original title after a short delay.

func ShowToastOnTable

func ShowToastOnTable(app *tview.Application, table *tview.Table)

ShowToastOnTable temporarily changes a table's title to show a toast message, then restores the original title after a short delay.

func ShowToastOnTreeView

func ShowToastOnTreeView(app *tview.Application, tree *tview.TreeView)

ShowToastOnTreeView temporarily changes a tree view's title to show a toast message, then restores the original title after a short delay.

Types

type Boxed

type Boxed interface {
	GetTitle() string
	SetTitle(title string) *tview.Box
}

Boxed is an interface for tview primitives that have Get/SetTitle (i.e. embed tview.Box).

type Column

type Column struct {
	Name  string
	Width int
}

type CustomShortCut

type CustomShortCut struct {
	Name        string
	Description string
	Rune        rune
	Key         tcell.Key
	Handle      func(event *tcell.EventKey) *tcell.EventKey
}

type CustomShortCutProperties

type CustomShortCutProperties struct {
	Shortcuts []CustomShortCut
}

func (CustomShortCutProperties) Len

func (c CustomShortCutProperties) Len() int

func (CustomShortCutProperties) Less

func (c CustomShortCutProperties) Less(i, j int) bool

func (CustomShortCutProperties) Swap

func (c CustomShortCutProperties) Swap(i, j int)

type CustomTableViewProperties

type CustomTableViewProperties struct {
	Title          string
	Columns        []Column
	Rows           [][]string
	RowData        []interface{}
	Handler        func(selectedProfileName string)
	ShowJsonViewer bool
	App            *tview.Application
	RestoreRoot    func()
	CreateHeader   func() *tview.Flex
	CreateFooter   func([]string) *tview.Table
	LogView        *tview.TextView
	IsLogEnabled   bool
}
type DropdownField struct {
	Label        string
	Key          string
	Options      []string
	DefaultIndex int
}

DropdownField represents a dropdown selection field in a form

type InputField

type InputField struct {
	Label        string
	Key          string
	DefaultValue string
}

type InputFormProperties

type InputFormProperties struct {
	Title          string
	Fields         []InputField
	DropdownFields []DropdownField
	OnSubmit       func(values map[string]string)
	OnCancel       func()
	App            *tview.Application
	PreviousView   tview.Primitive
}

type JsonViewerProperties

type JsonViewerProperties struct {
	Title  string
	Data   interface{}
	App    *tview.Application
	OnBack func()
}

type ListViewBoxProperties

type ListViewBoxProperties struct {
	Title   string
	Options []string
	Handler func(selectedOption string)
	App     *tview.Application
}

type ModalChoice

type ModalChoice struct {
	Name    string
	Handler func(currentFlex *tview.Flex)
}

type ModalProperties

type ModalProperties struct {
	Title       string
	LeftChoice  ModalChoice
	RightChoice ModalChoice
}

Jump to

Keyboard shortcuts

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