tui

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BackgroundColor = lipgloss.CompleteColor{
		TrueColor: "#3B4252",
		ANSI256:   "59",
		ANSI:      "4",
	}
	HeaderColor = lipgloss.CompleteColor{
		TrueColor: "#5e81ac",
		ANSI256:   "67",
		ANSI:      "4",
	}
	SelectedColor = lipgloss.CompleteColor{
		TrueColor: "#4C566A",
		ANSI256:   "60",
		ANSI:      "4",
	}
	BorderOutlineColor = lipgloss.CompleteColor{
		TrueColor: "#8fbcbb",
		ANSI256:   "115",
		ANSI:      "6",
	}
)
View Source
var BaseStyle = lipgloss.NewStyle().
	BorderStyle(lipgloss.HiddenBorder()).
	Background(BackgroundColor)
View Source
var HeaderStyle = table.DefaultStyles().Header.Copy().
	Background(HeaderColor).
	Bold(true)
View Source
var HistoryKeymap = historyKeymap{
	Quit:        key.NewBinding(key.WithKeys("q"), key.WithHelp("q", "quit")),
	LineUp:      key.NewBinding(key.WithKeys("up", "k"), key.WithHelp("↑/k", "up")),
	LineDown:    key.NewBinding(key.WithKeys("down", "j"), key.WithHelp("↓/j", "down")),
	PageUp:      key.NewBinding(key.WithKeys("pgup"), key.WithHelp("pgup", "page up")),
	PageDown:    key.NewBinding(key.WithKeys("pgdown"), key.WithHelp("pgdn", "page down")),
	GotoTop:     key.NewBinding(key.WithKeys("g"), key.WithHelp("g", "go to start")),
	GotoBottom:  key.NewBinding(key.WithKeys("G"), key.WithHelp("G", "go to end")),
	SwitchFocus: key.NewBinding(key.WithKeys("tab"), key.WithHelp("tab", "switch focus")),
	DiffView:    key.NewBinding(key.WithKeys("d"), key.WithHelp("d", "toggle diff view")),
}
View Source
var SelectedStyle = table.DefaultStyles().Selected.Copy().
	Background(SelectedColor).
	Foreground(lipgloss.NoColor{})

Functions

func NewTable

func NewTable(cols []table.Column, opts ...table.Option) table.Model

Types

type ClusterListModel

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

func NewClusterListModel

func NewClusterListModel() ClusterListModel

func (ClusterListModel) Init

func (m ClusterListModel) Init() tea.Cmd

func (ClusterListModel) Update

func (m ClusterListModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ClusterListModel) View

func (m ClusterListModel) View() string

type ClusterListWatcher

type ClusterListWatcher struct {
	Messages chan tea.Msg
	Client   managementv1.ManagementClient
}

func (*ClusterListWatcher) Run

type HistoryUI

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

func NewHistoryUI

func NewHistoryUI[T driverutil.ConfigType[T]](ts []T) *HistoryUI

func (*HistoryUI) Run

func (ui *HistoryUI) Run() error

type Keymap

type Keymap struct {
	table.KeyMap
	Quit key.Binding
}

func NewTableKeymap

func NewTableKeymap() Keymap

func (Keymap) FullHelp

func (km Keymap) FullHelp() [][]key.Binding

func (Keymap) ShortHelp

func (km Keymap) ShortHelp() []key.Binding

type Ref

type Ref[T any] struct {
	V *T
	R *corev1.Reference
}

Jump to

Keyboard shortcuts

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