ui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ViewsSwitchableByTab = []Focused{
		TableFocused,
		SearchFocused,
	}
)

nolint:gochecknoglobals

Functions

func ApplyIDsFilter added in v0.2.1

func ApplyIDsFilter(previous []resource.Resource, filter resource.SetOfIDs) []resource.Resource

Types

type ActionsKeyMap added in v0.2.0

type ActionsKeyMap struct {
	RootKeyMap
	Do         key.Binding
	ListKeyMap list.KeyMap
}

func (ActionsKeyMap) ShortHelp added in v0.2.0

func (m ActionsKeyMap) ShortHelp() []key.Binding

type ApplicationState

type ApplicationState struct {
	Logger *slog.Logger

	Store   resource.Storer
	Search  resource.Searcher
	Monitor resource.Monitorer

	ScwClient         *scw.Client
	ScwProfileName    string
	ProjectIDsToNames map[string]string

	Keys KeyMap

	Styles Styles

	// The theme to use for syntax highlighting.
	SyntaxHighlighterTheme string
}

ApplicationState is the state passed to the UI. It contains the store and the Scaleway client.

type ConfirmKeyMap

type ConfirmKeyMap struct {
	RootKeyMap
	Confirm key.Binding
}

func (ConfirmKeyMap) FullHelp

func (m ConfirmKeyMap) FullHelp() [][]key.Binding

func (ConfirmKeyMap) ShortHelp

func (m ConfirmKeyMap) ShortHelp() []key.Binding

type Focused

type Focused int
const (
	TableFocused Focused = iota
	SearchFocused
	DescribeFocused
	ConfirmFocused
	ActionsFocused
	JournalFocused
	NumViews // The number of views in the app
)

type KeyMap

func DefaultKeyMap

func DefaultKeyMap() KeyMap

func (KeyMap) Get

func (m KeyMap) Get(focused Focused) help.KeyMap

type RootKeyMap

type RootKeyMap struct {
	Quit key.Binding
}

Those are the keybindings that are available in all scenes.

func (RootKeyMap) FullHelp

func (m RootKeyMap) FullHelp() [][]key.Binding

func (RootKeyMap) ShortHelp

func (m RootKeyMap) ShortHelp() []key.Binding

type Styles

type Styles struct {
	BaseBorder lipgloss.Style
	Title      lipgloss.Style
	Error      lipgloss.Style

	ModalWidth int
	Modal      lipgloss.Style
}

func DefaultStyles

func DefaultStyles() Styles

type TableKeyMap

type TableKeyMap struct {
	RootKeyMap
	Search        key.Binding
	Describe      key.Binding
	Logs          key.Binding
	Delete        key.Binding
	Actions       key.Binding
	ToggleAltView key.Binding
}

func (TableKeyMap) FullHelp

func (m TableKeyMap) FullHelp() [][]key.Binding

func (TableKeyMap) ShortHelp

func (m TableKeyMap) ShortHelp() []key.Binding

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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