components

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowConfirm

func ShowConfirm(app *tui.App, title, message string, onYes, onNo func())

ShowConfirm displays a Yes/No confirmation modal

func ShowError

func ShowError(app *tui.App, title, message string)

ShowError displays an error modal

func ShowErrorInline

func ShowErrorInline(app *tui.App, title, message string, returnTo tview.Primitive)

ShowErrorInline displays an error modal that returns to the previous screen instead of stopping the app

func ShowInfo

func ShowInfo(app *tui.App, title, message string)

ShowInfo displays an informational modal

func ShowSuccess

func ShowSuccess(app *tui.App, title, message string)

ShowSuccess displays a success modal

func ShowWarning

func ShowWarning(app *tui.App, title, message string)

ShowWarning displays a warning modal

Types

type Form

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

Form wraps tview.Form with Proxmox styling and validation

func NewForm

func NewForm(app *tui.App) *Form

NewForm creates a new form with Proxmox styling

func (*Form) AddCancelButton

func (f *Form) AddCancelButton(label string) *Form

AddCancelButton adds a styled cancel button

func (*Form) AddInputFieldWithValidation

func (f *Form) AddInputFieldWithValidation(label, value string, fieldWidth int, validators ...ValidatorFunc) *Form

AddInputFieldWithValidation adds an input field with validation

func (*Form) AddPasswordField

func (f *Form) AddPasswordField(label string, fieldWidth int, validators ...ValidatorFunc) *Form

AddPasswordField adds a password field (masked input)

func (*Form) AddSubmitButton

func (f *Form) AddSubmitButton(label string) *Form

AddSubmitButton adds a styled submit button

func (*Form) GetFormValues

func (f *Form) GetFormValues() map[string]string

GetFormValues extracts all form values

func (*Form) SetBorderWithTitle

func (f *Form) SetBorderWithTitle(title string) *Form

SetBorderWithTitle sets border and title with Proxmox styling

func (*Form) SetOnCancel

func (f *Form) SetOnCancel(handler func()) *Form

SetOnCancel sets the cancel handler

func (*Form) SetOnSubmit

func (f *Form) SetOnSubmit(handler func(values map[string]string) error) *Form

SetOnSubmit sets the submit handler

func (*Form) SetParentView

func (f *Form) SetParentView(parent tview.Primitive) *Form

SetParentView sets the parent layout containing this form (for inline error display)

func (*Form) ValidateAll

func (f *Form) ValidateAll(values map[string]string) error

ValidateAll validates all fields

type FormField

type FormField struct {
	Label      string
	Value      string
	Validators []ValidatorFunc
	Hidden     bool
}

FormField represents a form field with validation

type ListFormItem

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

ListFormItem wraps a tview.List so it can be used inside a Form.

func NewListFormItem

func NewListFormItem(list *tview.List) *ListFormItem

NewListFormItem creates a new list-backed form item.

func (*ListFormItem) Blur

func (i *ListFormItem) Blur()

Blur is called when this primitive loses focus.

func (*ListFormItem) Focus

func (i *ListFormItem) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*ListFormItem) GetFieldHeight

func (i *ListFormItem) GetFieldHeight() int

GetFieldHeight implements tview.FormItem.

func (*ListFormItem) GetFieldWidth

func (i *ListFormItem) GetFieldWidth() int

GetFieldWidth implements tview.FormItem.

func (*ListFormItem) GetLabel

func (i *ListFormItem) GetLabel() string

GetLabel implements tview.FormItem.

func (*ListFormItem) SetDisabled

func (i *ListFormItem) SetDisabled(disabled bool) tview.FormItem

SetDisabled implements tview.FormItem.

func (*ListFormItem) SetFieldHeight

func (i *ListFormItem) SetFieldHeight(height int) *ListFormItem

SetFieldHeight configures the height used by the list within the form.

func (*ListFormItem) SetFieldWidth

func (i *ListFormItem) SetFieldWidth(width int) *ListFormItem

SetFieldWidth configures the width used by the list within the form (0 = flexible).

func (*ListFormItem) SetFinishedFunc

func (i *ListFormItem) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem

SetFinishedFunc implements tview.FormItem.

func (*ListFormItem) SetFormAttributes

func (i *ListFormItem) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem

SetFormAttributes implements tview.FormItem.

func (*ListFormItem) SetLabel

func (i *ListFormItem) SetLabel(label string) *ListFormItem

SetLabel sets the optional label shown before the list within the form.

type Panel

type Panel struct {
	*tview.Box
}

Panel is a styled box with Proxmox theming

func ErrorPanel

func ErrorPanel(title, message string) *Panel

ErrorPanel creates an error-styled panel

func InfoPanel

func InfoPanel(title, message string) *Panel

InfoPanel creates a styled info panel

func NewPanel

func NewPanel() *Panel

NewPanel creates a new panel with Proxmox styling

func SuccessPanel

func SuccessPanel(title, message string) *Panel

SuccessPanel creates a success-styled panel

func WarningPanel

func WarningPanel(title, message string) *Panel

WarningPanel creates a warning-styled panel

func (*Panel) SetStatus

func (p *Panel) SetStatus(status string) *Panel

SetStatus sets a status indicator in the title

func (*Panel) SetTitle

func (p *Panel) SetTitle(title string) *Panel

SetTitle sets the panel title

type ValidatorFunc

type ValidatorFunc func(value string) error

ValidatorFunc is a function that validates an input value

Jump to

Keyboard shortcuts

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