ui

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EmptyCell represents an empty cell in the table.
	EmptyCell = ""
)

Variables

This section is empty.

Functions

func NewFilesystemEvtChan

func NewFilesystemEvtChan() chan model.K8sConfigFileChangeEvent

NewFilesystemEvtChan return file system event channel

func NewNetEvtChan

func NewNetEvtChan() chan model.K8sAPICallEvent

NewNetEvtChan return net event channel

Types

type KubeKnarkUI

type KubeKnarkUI struct {
	NetEvtChan chan model.K8sAPICallEvent
	FsEvtChan  chan model.K8sConfigFileChangeEvent
	// contains filtered or unexported fields
}

KubeKnarkUI return UI object

func NewKubeKnarkUI

func NewKubeKnarkUI(netData chan model.K8sAPICallEvent, fsData chan model.K8sConfigFileChangeEvent) *KubeKnarkUI

NewKubeKnarkUI return new KubeKnarkUI object

func (*KubeKnarkUI) Draw

func (kui *KubeKnarkUI) Draw(errNetChan chan error)

Draw draw ui kube knark ui with paragraph and lists

type Table

type Table struct {
	*widgets.Table

	//Rows are the rows of the table.
	Rows TableRows

	// colors which will be used to paint the table rows.
	Colors struct {
		// default color of each row
		Text termui.Color
		// text color of the selected row
		SelectedRowFg termui.Color
		// row color of the selected row
		SelectedRowBg termui.Color
	}
	// contains filtered or unexported fields
}

Table is extending the Table in the termui/v3/widgets/ package to support scrolling/filtering.

func NewTable

func NewTable(lightTheme bool) *Table

NewTable returns a default instance of xtui.Table.

func (*Table) Draw

func (t *Table) Draw(buf *termui.Buffer)

Draw extends the method Draw from tui.Table to also include filtering.

func (*Table) ScrollDown

func (t *Table) ScrollDown()

ScrollDown scrolls the table one row down

func (*Table) ScrollUp

func (t *Table) ScrollUp()

ScrollUp scrolls the table one row up

func (*Table) SetRect

func (t *Table) SetRect(x, y, x1, y2 int)

SetRect resize the table, and correctly sets the height of the table. x,y : top left corner x1,y2 : bottom right corner

type TableRows

type TableRows [][]string

TableRows represent the rows of the table.

Jump to

Keyboard shortcuts

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