Documentation
¶
Index ¶
- func ShowConfirm(app *tui.App, title, message string, onYes, onNo func())
- func ShowError(app *tui.App, title, message string)
- func ShowErrorInline(app *tui.App, title, message string, returnTo tview.Primitive)
- func ShowInfo(app *tui.App, title, message string)
- func ShowSuccess(app *tui.App, title, message string)
- func ShowWarning(app *tui.App, title, message string)
- type Form
- func (f *Form) AddCancelButton(label string) *Form
- func (f *Form) AddInputFieldWithValidation(label, value string, fieldWidth int, validators ...ValidatorFunc) *Form
- func (f *Form) AddPasswordField(label string, fieldWidth int, validators ...ValidatorFunc) *Form
- func (f *Form) AddSubmitButton(label string) *Form
- func (f *Form) GetFormValues() map[string]string
- func (f *Form) SetBorderWithTitle(title string) *Form
- func (f *Form) SetOnCancel(handler func()) *Form
- func (f *Form) SetOnSubmit(handler func(values map[string]string) error) *Form
- func (f *Form) SetParentView(parent tview.Primitive) *Form
- func (f *Form) ValidateAll(values map[string]string) error
- type FormField
- type ListFormItem
- func (i *ListFormItem) Blur()
- func (i *ListFormItem) Focus(delegate func(p tview.Primitive))
- func (i *ListFormItem) GetFieldHeight() int
- func (i *ListFormItem) GetFieldWidth() int
- func (i *ListFormItem) GetLabel() string
- func (i *ListFormItem) SetDisabled(disabled bool) tview.FormItem
- func (i *ListFormItem) SetFieldHeight(height int) *ListFormItem
- func (i *ListFormItem) SetFieldWidth(width int) *ListFormItem
- func (i *ListFormItem) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem
- func (i *ListFormItem) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem
- func (i *ListFormItem) SetLabel(label string) *ListFormItem
- type Panel
- type ValidatorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShowConfirm ¶
ShowConfirm displays a Yes/No confirmation modal
func ShowErrorInline ¶
ShowErrorInline displays an error modal that returns to the previous screen instead of stopping the app
func ShowSuccess ¶
ShowSuccess displays a success modal
func ShowWarning ¶
ShowWarning displays a warning modal
Types ¶
type Form ¶
Form wraps tview.Form with Proxmox styling and validation
func (*Form) AddCancelButton ¶
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 ¶
AddSubmitButton adds a styled submit button
func (*Form) GetFormValues ¶
GetFormValues extracts all form values
func (*Form) SetBorderWithTitle ¶
SetBorderWithTitle sets border and title with Proxmox styling
func (*Form) SetOnCancel ¶
SetOnCancel sets the cancel handler
func (*Form) SetOnSubmit ¶
SetOnSubmit sets the submit handler
func (*Form) SetParentView ¶
SetParentView sets the parent layout containing this form (for inline error display)
type FormField ¶
type FormField struct {
Label string
Value string
Validators []ValidatorFunc
Hidden bool
}
FormField represents a form field with validation
type ListFormItem ¶
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 ¶
Panel is a styled box with Proxmox theming
func ErrorPanel ¶
ErrorPanel creates an error-styled panel
func SuccessPanel ¶
SuccessPanel creates a success-styled panel
func WarningPanel ¶
WarningPanel creates a warning-styled panel
type ValidatorFunc ¶
ValidatorFunc is a function that validates an input value