component

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigContext

type ConfigContext struct {
	// contains filtered or unexported fields
}

ConfigContext table selecting and deleting contexts (configurations)

func NewConfigContext

func NewConfigContext(
	current int,
	confs []*config.Config,
	onSelect func(id int),
	onDelete func(name string, id int),
) *ConfigContext

NewConfigContext returns a new instance of NewConfigContext

func (*ConfigContext) Primitive

func (c *ConfigContext) Primitive() tview.Primitive

Primitive returns the root primitive for ConfigContext

func (*ConfigContext) UpdateConfigs

func (c *ConfigContext) UpdateConfigs(current int, confs []*config.Config)

UpdateConfigs updates the table with a new list of contexts

type ConfigureForm

type ConfigureForm struct {
	// contains filtered or unexported fields
}

ConfigureForm component for updating and creating configurations

func NewConfigureForm

func NewConfigureForm(
	conf config.Config,
	onUpdate func(conf config.Config),
	onCreate func(conf config.Config),
	onDismiss func(),
) *ConfigureForm

NewConfigureForm returns a new instance of ConfigureForm

func (*ConfigureForm) Primitive

func (f *ConfigureForm) Primitive() tview.Primitive

Primitive return the root primitive for ConfigureForm

type EventTable

type EventTable struct {
	// contains filtered or unexported fields
}

EvenTable table for viewing all incoming events in realtime

func NewEventTable

func NewEventTable() *EventTable

NewEventTable returns a new instance of EventTable

func (*EventTable) Primitive

func (t *EventTable) Primitive() tview.Primitive

Primitive returns the root primitive for EventTable

func (*EventTable) UpdateTable

func (t *EventTable) UpdateTable(evt *event.Event)

UpdateTable adds a new event to the table and removes oldest row if we've reached configured maximum for events to display

type Header struct {
	// contains filtered or unexported fields
}

Header shown above all views. Includes app title and dynamic key legend

func NewHeader

func NewHeader(
	userIP string,
	targets []string,
	onViewSwitch func(text string),
) *Header

NewHeader returns a new instance of Header

func (*Header) AddLegendKey

func (h *Header) AddLegendKey(key, description string)

AddLegendKey adds a new key and description to the legend

func (*Header) Primitive

func (h *Header) Primitive() tview.Primitive

Primitive returns the root primitive for Header

func (*Header) RemoveAllExtraLegendKeys

func (h *Header) RemoveAllExtraLegendKeys()

RemoveAllExtraLegendKeys removes all non-default keys and descriptions from legend

func (*Header) RemoveLegendKey

func (h *Header) RemoveLegendKey(key string)

RemoveLegendKey removes key and description from legend

func (*Header) SwitchViewInput

func (h *Header) SwitchViewInput() *SwitchViewInput

SwitchViewInput returns access to the Header's SwitchViewInput component

type Modal struct {
	// contains filtered or unexported fields
}

Modal generic structure for displaying modals

func NewModal

func NewModal(message string, buttons []ModalButton) *Modal

NewModal returns a new instance of Modal

func (*Modal) Primitive

func (m *Modal) Primitive() tview.Primitive

Primitive returns the root primitive for Modal

type ModalButton

type ModalButton struct {
	Label   string
	OnClick func()
}

ModalButton represents a button added to a modal

type ServerTable

type ServerTable struct {
	// contains filtered or unexported fields
}

ServerTable table displaying all servers for the active context

func NewServerTable

func NewServerTable(OnSSH func(ip string)) *ServerTable

NewServerTable returns a new instance of ServerTable

func (*ServerTable) Primitive

func (t *ServerTable) Primitive() tview.Primitive

Primitive returns the root primitive for ServerTable

func (*ServerTable) UpdateTable

func (t *ServerTable) UpdateTable(servers []*server.Server)

UpdateTable updates the table with the incoming list of servers from the database. We expect these servers to always be sorted so the ordering should remain relatively consistent.

type SwitchViewInput

type SwitchViewInput struct {
	// contains filtered or unexported fields
}

SwitchViewInput toggle-able input for switching views

func NewSwitchViewInput

func NewSwitchViewInput(onSubmit func(text string)) *SwitchViewInput

NewSwitchViewInput returns a new instance of SwitchViewInput

func (*SwitchViewInput) Primitive

func (i *SwitchViewInput) Primitive() tview.Primitive

Primitive returns the root primitive for SwitchViewInput

Jump to

Keyboard shortcuts

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