dialogs

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// top dialog header label.
	MessageSystemInfo messageInfo = 0 + iota
	MessagePodInfo
	MessageContainerInfo
	MessageVolumeInfo
	MessageImageInfo
	MessageNetworkInfo
	MessageSecretInfo
)
View Source
const (
	// top dialog header label.
	TopPodInfo topInfo = 0 + iota
	TopContainerInfo
)
View Source
const (
	// DialogPadding dialog inner paddign.
	DialogPadding = 3

	// DialogFormHeight dialog "Enter"/"Cancel" form height.
	DialogFormHeight = 3

	// DialogMinWidth dialog min width.
	DialogMinWidth = 40

	// TableHeightOffset table height offset for border.
	TableHeightOffset = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandDialog

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

CommandDialog is a commands list dialog.

func NewCommandDialog

func NewCommandDialog(options [][]string) *CommandDialog

NewCommandDialog returns a command list primitive.

func (*CommandDialog) Display

func (cmd *CommandDialog) Display()

Display displays this primitive.

func (*CommandDialog) Draw

func (cmd *CommandDialog) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*CommandDialog) Focus

func (cmd *CommandDialog) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*CommandDialog) GetCommandCount

func (cmd *CommandDialog) GetCommandCount() int

GetCommandCount returns number of commands.

func (*CommandDialog) GetSelectedItem

func (cmd *CommandDialog) GetSelectedItem() string

GetSelectedItem returns selected row item.

func (*CommandDialog) HasFocus

func (cmd *CommandDialog) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*CommandDialog) Hide

func (cmd *CommandDialog) Hide()

Hide stops displaying this primitive.

func (*CommandDialog) InputHandler

func (cmd *CommandDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns input handler function for this primitive.

func (*CommandDialog) IsDisplay

func (cmd *CommandDialog) IsDisplay() bool

IsDisplay returns true if primitive is shown.

func (*CommandDialog) SetCancelFunc

func (cmd *CommandDialog) SetCancelFunc(handler func()) *CommandDialog

SetCancelFunc sets form cancel button selected function.

func (*CommandDialog) SetRect

func (cmd *CommandDialog) SetRect(x, y, width, height int)

SetRect set rects for this primitive.

func (*CommandDialog) SetSelectedFunc

func (cmd *CommandDialog) SetSelectedFunc(handler func()) *CommandDialog

SetSelectedFunc sets form enter button selected function.

type ConfirmDialog

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

ConfirmDialog is a simple confirmation dialog primitive.

func NewConfirmDialog

func NewConfirmDialog() *ConfirmDialog

NewConfirmDialog returns new confirm dialog primitive.

func (*ConfirmDialog) Display

func (d *ConfirmDialog) Display()

Display displays this primitive.

func (*ConfirmDialog) Draw

func (d *ConfirmDialog) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*ConfirmDialog) Focus

func (d *ConfirmDialog) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*ConfirmDialog) HasFocus

func (d *ConfirmDialog) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*ConfirmDialog) Hide

func (d *ConfirmDialog) Hide()

Hide stops displaying this primitive.

func (*ConfirmDialog) InputHandler

func (d *ConfirmDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns input handler function for this primitive.

func (*ConfirmDialog) IsDisplay

func (d *ConfirmDialog) IsDisplay() bool

IsDisplay returns true if primitive is shown.

func (*ConfirmDialog) SetCancelFunc

func (d *ConfirmDialog) SetCancelFunc(handler func()) *ConfirmDialog

SetCancelFunc sets form cancel button selected function.

func (*ConfirmDialog) SetRect

func (d *ConfirmDialog) SetRect(x, y, width, height int)

SetRect set rects for this primitive.

func (*ConfirmDialog) SetSelectedFunc

func (d *ConfirmDialog) SetSelectedFunc(handler func()) *ConfirmDialog

SetSelectedFunc sets form select button selected function.

func (*ConfirmDialog) SetText

func (d *ConfirmDialog) SetText(message string)

SetText sets dialog title.

func (*ConfirmDialog) SetTitle

func (d *ConfirmDialog) SetTitle(title string)

SetTitle sets dialog title.

type ErrorDialog

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

ErrorDialog is an error dialog primitive.

func NewErrorDialog

func NewErrorDialog() *ErrorDialog

NewErrorDialog returns new error dialog primitive.

func (*ErrorDialog) Display

func (d *ErrorDialog) Display()

Display displays this primitive.

func (*ErrorDialog) Draw

func (d *ErrorDialog) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*ErrorDialog) Focus

func (d *ErrorDialog) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*ErrorDialog) GetRect

func (d *ErrorDialog) GetRect() (int, int, int, int)

GetRect returns the current position of the primitive, x, y, width, and height.

func (*ErrorDialog) HasFocus

func (d *ErrorDialog) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*ErrorDialog) Hide

func (d *ErrorDialog) Hide()

Hide stops displaying this primitive.

func (*ErrorDialog) InputHandler

func (d *ErrorDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns input handler function for this primitive.

func (*ErrorDialog) IsDisplay

func (d *ErrorDialog) IsDisplay() bool

IsDisplay returns true if primitive is shown.

func (*ErrorDialog) SetDoneFunc

func (d *ErrorDialog) SetDoneFunc(handler func()) *ErrorDialog

SetDoneFunc sets modal done function.

func (*ErrorDialog) SetRect

func (d *ErrorDialog) SetRect(x, y, width, height int)

SetRect set rects for this primitive.

func (*ErrorDialog) SetText

func (d *ErrorDialog) SetText(message string)

SetText sets error dialog message.

func (*ErrorDialog) SetTitle added in v0.3.1

func (d *ErrorDialog) SetTitle(title string)

SetTitle sets error dialog message title.

type MessageDialog

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

MessageDialog is a simaple message dialog primitive.

func NewMessageDialog

func NewMessageDialog(text string) *MessageDialog

NewMessageDialog returns new message dialog primitive.

func (*MessageDialog) Display

func (d *MessageDialog) Display()

Display displays this primitive.

func (*MessageDialog) Draw

func (d *MessageDialog) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*MessageDialog) Focus

func (d *MessageDialog) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*MessageDialog) HasFocus

func (d *MessageDialog) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*MessageDialog) Hide

func (d *MessageDialog) Hide()

Hide stops displaying this primitive.

func (*MessageDialog) InputHandler

func (d *MessageDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns input handler function for this primitive.

func (*MessageDialog) IsDisplay

func (d *MessageDialog) IsDisplay() bool

IsDisplay returns true if primitive is shown.

func (*MessageDialog) SetCancelFunc

func (d *MessageDialog) SetCancelFunc(handler func()) *MessageDialog

SetCancelFunc sets form cancel button selected function.

func (*MessageDialog) SetRect

func (d *MessageDialog) SetRect(x, y, width, height int)

SetRect set rects for this primitive.

func (*MessageDialog) SetText

func (d *MessageDialog) SetText(headerType messageInfo, headerMessage string, message string)

SetText sets message dialog text messages.

func (*MessageDialog) SetTitle

func (d *MessageDialog) SetTitle(title string)

SetTitle sets input dialog title.

func (*MessageDialog) TextScrollToEnd

func (d *MessageDialog) TextScrollToEnd()

TextScrollToEnd scroll downs the text view.

type ProgressDialog

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

ProgressDialog represents progress bar permitive.

func NewProgressDialog

func NewProgressDialog() *ProgressDialog

NewProgressDialog returns new progress dialog primitive.

func (*ProgressDialog) Display

func (d *ProgressDialog) Display()

Display displays this primitive.

func (*ProgressDialog) Draw

func (d *ProgressDialog) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*ProgressDialog) Focus

func (d *ProgressDialog) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*ProgressDialog) HasFocus

func (d *ProgressDialog) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*ProgressDialog) Hide

func (d *ProgressDialog) Hide()

Hide Hides this primitive.

func (*ProgressDialog) InputHandler

func (d *ProgressDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns input handler function for this primitive.

func (*ProgressDialog) IsDisplay

func (d *ProgressDialog) IsDisplay() bool

IsDisplay returns true if primitive is shown.

func (*ProgressDialog) SetRect

func (d *ProgressDialog) SetRect(x, y, width, height int)

SetRect set rects for this primitive.

func (*ProgressDialog) SetTitle

func (d *ProgressDialog) SetTitle(title string)

SetTitle sets title for this primitive.

type SimpleInputDialog

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

SimpleInputDialog is an input dialog primitive.

func NewSimpleInputDialog

func NewSimpleInputDialog(text string) *SimpleInputDialog

NewSimpleInputDialog returns new input dialog primitive.

func (*SimpleInputDialog) Display

func (d *SimpleInputDialog) Display()

Display displays this primitive.

func (*SimpleInputDialog) Draw

func (d *SimpleInputDialog) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*SimpleInputDialog) Focus

func (d *SimpleInputDialog) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*SimpleInputDialog) GetInputText

func (d *SimpleInputDialog) GetInputText() string

GetInputText returns input dialog input field value.

func (*SimpleInputDialog) GetRect

func (d *SimpleInputDialog) GetRect() (int, int, int, int)

GetRect returns the current position of the primitive, x, y, width, and height.

func (*SimpleInputDialog) HasFocus

func (d *SimpleInputDialog) HasFocus() bool

HasFocus returns whether or not this primitive has focus.

func (*SimpleInputDialog) Hide

func (d *SimpleInputDialog) Hide()

Hide stops displaying this primitive.

func (*SimpleInputDialog) InputHandler

func (d *SimpleInputDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns input handler function for this primitive.

func (*SimpleInputDialog) IsDisplay

func (d *SimpleInputDialog) IsDisplay() bool

IsDisplay returns true if primitive is shown.

func (*SimpleInputDialog) SetCancelFunc

func (d *SimpleInputDialog) SetCancelFunc(handler func()) *SimpleInputDialog

SetCancelFunc sets form cancel button selected function.

func (*SimpleInputDialog) SetDescription

func (d *SimpleInputDialog) SetDescription(text string)

SetDescription sets dialogs description.

func (*SimpleInputDialog) SetInputText

func (d *SimpleInputDialog) SetInputText(text string)

SetInputText sets input dialog default value.

func (*SimpleInputDialog) SetLabel

func (d *SimpleInputDialog) SetLabel(text string)

SetLabel sets input fields label message.

func (*SimpleInputDialog) SetRect

func (d *SimpleInputDialog) SetRect(x, y, width, height int)

SetRect set rects for this primitive.

func (*SimpleInputDialog) SetSelectButtonLabel

func (d *SimpleInputDialog) SetSelectButtonLabel(label string)

SetSelectButtonLabel sets form select/enter button name.

func (*SimpleInputDialog) SetSelectedFunc

func (d *SimpleInputDialog) SetSelectedFunc(handler func()) *SimpleInputDialog

SetSelectedFunc sets form enter button selected function.

func (*SimpleInputDialog) SetTitle

func (d *SimpleInputDialog) SetTitle(title string)

SetTitle sets input dialog title.

type TopDialog

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

TopDialog is a simple dialog with pod/container top result table.

func NewTopDialog

func NewTopDialog() *TopDialog

NewTopDialog returns new TopDialog primitive.

func (*TopDialog) Display

func (d *TopDialog) Display()

Display displays this primitive.

func (*TopDialog) Draw

func (d *TopDialog) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*TopDialog) Focus

func (d *TopDialog) Focus(delegate func(p tview.Primitive))

Focus is called when this primitive receives focus.

func (*TopDialog) HasFocus

func (d *TopDialog) HasFocus() bool

HasFocus returns true if this primitive has focus.

func (*TopDialog) Hide

func (d *TopDialog) Hide()

Hide stops displaying this primitive.

func (*TopDialog) InputHandler

func (d *TopDialog) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns input handler function for this primitive.

func (*TopDialog) IsDisplay

func (d *TopDialog) IsDisplay() bool

IsDisplay returns true if primitive is shown.

func (*TopDialog) SetCancelFunc added in v0.5.0

func (d *TopDialog) SetCancelFunc(handler func()) *TopDialog

SetCancelFunc sets form button selected function.

func (*TopDialog) SetRect

func (d *TopDialog) SetRect(x, y, width, height int)

SetRect set rects for this primitive.

func (*TopDialog) SetTitle

func (d *TopDialog) SetTitle(title string)

SetTitle sets title for the dialog.

func (*TopDialog) UpdateResults

func (d *TopDialog) UpdateResults(infoType topInfo, id string, name string, data [][]string)

UpdateResults updates result table.

Jump to

Keyboard shortcuts

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