Documentation
¶
Index ¶
- Constants
- func CreateCustomListView(properties ListViewBoxProperties) *tview.List
- func CreateCustomShortCutsView(App *tview.Application, properties CustomShortCutProperties) *tview.Table
- func CreateCustomTableView(properties CustomTableViewProperties) *tview.Table
- func CreateErrorModal(background tview.Primitive, message string, onDismiss func()) *tview.Pages
- func CreateInputForm(properties InputFormProperties) *tview.Form
- func CreateJsonTextViewer(properties JsonViewerProperties) *tview.TextView
- func CreateJsonTreeViewer(properties JsonViewerProperties) *tview.TreeView
- func CreateModal(properties ModalProperties, currentFlex *tview.Flex) *tview.Modal
- func ShowLoadingAnimation(app *tview.Application, background tview.Primitive, done <-chan struct{}, ...) *tview.Pages
- func ShowToast(app *tview.Application, widget Boxed, message string)
- func ShowToastOnList(app *tview.Application, list *tview.List)
- func ShowToastOnTable(app *tview.Application, table *tview.Table)
- func ShowToastOnTreeView(app *tview.Application, tree *tview.TreeView)
- type Boxed
- type Column
- type CustomShortCut
- type CustomShortCutProperties
- type CustomTableViewProperties
- type DropdownField
- type InputField
- type InputFormProperties
- type JsonViewerProperties
- type ListViewBoxProperties
- type ModalChoice
- type ModalProperties
Constants ¶
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 ¶
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 ¶
Boxed is an interface for tview primitives that have Get/SetTitle (i.e. embed tview.Box).
type CustomShortCut ¶
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 DropdownField ¶
DropdownField represents a dropdown selection field in a form
type InputField ¶
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 ModalProperties ¶
type ModalProperties struct {
Title string
LeftChoice ModalChoice
RightChoice ModalChoice
}