modal

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HistoryModalId = "History"
	QueryBarId     = "QueryBar"
)
View Source
const (
	ErrorModalId = "Error"
)
View Source
const (
	InfoModalId = "Info"
)
View Source
const ServerInfoModalId = "ServerInfoModal"
View Source
const (
	StyleChangeModal = "StyleChangeModal"
)

Variables

This section is empty.

Functions

func NewError

func NewError(message string, err error) *tview.Modal

func NewInfo

func NewInfo(message string) *tview.Modal

func ShowError

func ShowError(page *core.Pages, message string, err error)

ShowError shows a modal with an error message and logs the error if it's passed

func ShowErrorAndSetFocus

func ShowErrorAndSetFocus(page *core.Pages, message string, err error, setFocus func())

func ShowInfo

func ShowInfo(page *core.Pages, message string)

ShowInfo shows a modal with an informational message

func ShowInfoModalAndFocus

func ShowInfoModalAndFocus(page *core.Pages, message string, setFocus func())

Types

type Delete

type Delete struct {
	*core.BaseElement
	*core.Modal
	// contains filtered or unexported fields
}

func NewDeleteModal

func NewDeleteModal(id tview.Identifier) *Delete

type History

type History struct {
	*core.BaseElement
	*primitives.ListModal
	// contains filtered or unexported fields
}

History is a modal with history of queries

func NewHistoryModal

func NewHistoryModal() *History

func (*History) GetText

func (h *History) GetText() string

GetText returns text from selected item

func (*History) Render

func (h *History) Render()

Render loads history from file and renders it

func (*History) SaveToHistory

func (h *History) SaveToHistory(text string) error

SaveToHistory saves text to history file, if it's not already there. It will overwrite oldest entry if history is full.

func (*History) SetLayout added in v0.1.10

func (h *History) SetLayout()

type ServerInfoModal

type ServerInfoModal struct {
	*core.BaseElement
	*primitives.ViewModal
	// contains filtered or unexported fields
}

func NewServerInfoModal

func NewServerInfoModal(dao *mongo.Dao) *ServerInfoModal

func (*ServerInfoModal) Init

func (s *ServerInfoModal) Init(app *core.App)

func (*ServerInfoModal) Render

func (s *ServerInfoModal) Render(ctx context.Context) error

type StyleChange

type StyleChange struct {
	*core.BaseElement
	*primitives.ListModal
	// contains filtered or unexported fields
}

func NewStyleChangeModal

func NewStyleChangeModal() *StyleChange

func (*StyleChange) Render

func (sc *StyleChange) Render()

func (*StyleChange) SetApplyStyle

func (sc *StyleChange) SetApplyStyle(applyStyle func(styleName string) error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳