component

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyHelp corresponding value of keyboard key "?"
	KeyHelp = 63
	// KeySlash corresponding value of keyboard key "/"
	KeySlash = 47
	// KeyColon corresponding value of keyboard key ":"
	KeyColon = 58
	// KeySpace corresponding value of keyboard key "SPACE"
	KeySpace = 32
)
View Source
const (
	KeyA tcell.Key = iota + 97
	KeyB
	KeyC
	KeyD
	KeyE
	KeyF
	KeyG
	KeyH
	KeyI
	KeyJ
	KeyK
	KeyL
	KeyM
	KeyN
	KeyO
	KeyP
	KeyQ
	KeyR
	KeyS
	KeyT
	KeyU
	KeyV
	KeyW
	KeyX
	KeyY
	KeyZ
)

Defines char keystrokes.

Variables

This section is empty.

Functions

func StandardizeKey

func StandardizeKey(event *tcell.EventKey) tcell.Key

StandardizeKey standardized combined key event and return corresponding key

func WorkflowStepFormat

func WorkflowStepFormat(name string, status v1alpha1.WorkflowStepPhase) string

WorkflowStepFormat format the workflow step text with the emoji

Types

type App

type App struct {
	*tview.Application

	Main *tview.Pages
	// contains filtered or unexported fields
}

App represent the ui of application

func NewApp

func NewApp(themeConfig *config.ThemeConfig) *App

NewApp return the ui of application

func (*App) AddAction

func (a *App) AddAction(actions model.KeyActions)

AddAction add a new keyAction

func (*App) Components

func (a *App) Components() map[string]tview.Primitive

Components return the application root components.

func (*App) Crumbs

func (a *App) Crumbs() *Crumbs

Crumbs return the crumbs component

func (*App) DelAction

func (a *App) DelAction(keys []tcell.Key)

DelAction delete a keyAction

func (*App) HasAction

func (a *App) HasAction(key tcell.Key) (model.KeyAction, bool)

HasAction judge whether the key has the corresponding action

func (*App) InfoBoard

func (a *App) InfoBoard() *InfoBoard

InfoBoard return system info component

func (*App) Init

func (a *App) Init()

Init the ui of application init

func (a *App) Logo() *Logo

Logo return logo component

func (*App) Menu

func (a *App) Menu() *Menu

Menu return key action menu component

func (*App) QueueUpdate

func (a *App) QueueUpdate(f func())

QueueUpdate queues up a ui action.

func (*App) QueueUpdateDraw

func (a *App) QueueUpdateDraw(f func())

QueueUpdateDraw queues up a ui action and redraw the ui.

type Crumbs

type Crumbs struct {
	*tview.Flex
	// contains filtered or unexported fields
}

Crumbs component lay on footer of app and indicate resource level

func NewCrumbs

func NewCrumbs(config *config.ThemeConfig) *Crumbs

NewCrumbs return a new crumbs component

func (*Crumbs) StackPop

func (c *Crumbs) StackPop(_, _ model.View)

StackPop change itself when accept "pop" notify from app's main view

func (*Crumbs) StackPush

func (c *Crumbs) StackPush(_, new model.View)

StackPush change itself when accept "push" notify from app's main view

type InfoBoard

type InfoBoard struct {
	*tview.Table
	// contains filtered or unexported fields
}

InfoBoard a component which display system info

func NewInfo

func NewInfo(config *config.ThemeConfig) *InfoBoard

NewInfo return an info component instance

func (*InfoBoard) Init

func (board *InfoBoard) Init(restConf *rest.Config)

Init info component init

func (*InfoBoard) UpdateInfo

func (board *InfoBoard) UpdateInfo(restConf *rest.Config)

UpdateInfo update the info of system info board

type Logo struct {
	*tview.TextView
	// contains filtered or unexported fields
}

Logo logo component in header

func NewLogo(config *config.ThemeConfig) *Logo

NewLogo return logo ui component

type Menu struct {
	*tview.Table
	// contains filtered or unexported fields
}

Menu is menu component which display key actions of app's main view

func NewMenu

func NewMenu(config *config.ThemeConfig) *Menu

NewMenu return a new menu instance

func (m *Menu) StackPop(_, new model.View)

StackPop change itself when accept "pop" notify from app's main view

func (m *Menu) StackPush(_, new model.View)

StackPush change itself when accept "push" notify from app's main view

func (m *Menu) UpdateMenu(hints []model.MenuHint)

UpdateMenu update menu component

type Pages

type Pages struct {
	*tview.Pages
	*model.Stack
}

Pages is the app's main content view component

func NewPages

func NewPages() *Pages

NewPages return a page component

func (*Pages) Hint

func (p *Pages) Hint() []model.MenuHint

Hint return key action menu hints of the component

func (*Pages) Init

func (p *Pages) Init()

Init table component

func (*Pages) Name

func (p *Pages) Name() string

Name return pages' name

func (*Pages) StackPop

func (p *Pages) StackPop(old, _ model.View)

StackPop change itself when accept "pop" notify from app's main view

func (*Pages) StackPush

func (p *Pages) StackPush(_, new model.View)

StackPush change itself when accept "push" notify from app's main view

func (*Pages) Start

func (p *Pages) Start()

Start table component

func (*Pages) Stop

func (p *Pages) Stop()

Stop table component

type Table

type Table struct {
	*tview.Table
	// contains filtered or unexported fields
}

Table is a base table component which can be reused by other component

func NewTable

func NewTable(style *config.ThemeConfig) *Table

NewTable return a new table component

func (*Table) Actions

func (t *Table) Actions() model.KeyActions

Actions return actions

func (*Table) Hint

func (t *Table) Hint() []model.MenuHint

Hint return key action menu hints of the component

func (*Table) Init

func (t *Table) Init()

Init table component

func (*Table) Name

func (t *Table) Name() string

Name return table's name

func (*Table) Start

func (t *Table) Start()

Start table component

func (*Table) Stop

func (t *Table) Stop()

Stop table component

type ThemeSelector added in v1.7.0

type ThemeSelector struct {
	Frame *tview.Frame
	// contains filtered or unexported fields
}

ThemeSelector is used to select the theme

func NewThemeSelector added in v1.7.0

func NewThemeSelector(config *config.ThemeConfig, closeFun func()) *ThemeSelector

NewThemeSelector is used to create a new theme selector

func (*ThemeSelector) Init added in v1.7.0

func (s *ThemeSelector) Init()

Init is used to initialize the theme selector

func (*ThemeSelector) Start added in v1.7.0

func (s *ThemeSelector) Start()

Start is used to start the theme selector

type TopologyTreeNodeFormatter added in v1.7.0

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

TopologyTreeNodeFormatter is the formatter for the topology tree node

func NewTopologyTreeNodeFormatter added in v1.7.0

func NewTopologyTreeNodeFormatter(style *config.ThemeConfig) *TopologyTreeNodeFormatter

NewTopologyTreeNodeFormatter create a new topology tree node formatter

func (TopologyTreeNodeFormatter) ColorizeKind added in v1.7.0

func (t TopologyTreeNodeFormatter) ColorizeKind(kind string) string

ColorizeKind colorize the kind text

func (TopologyTreeNodeFormatter) ColorizeStatus added in v1.7.0

func (t TopologyTreeNodeFormatter) ColorizeStatus(status types.HealthStatusCode) string

ColorizeStatus colorize the status text

func (TopologyTreeNodeFormatter) EmojiFormat added in v1.7.0

func (t TopologyTreeNodeFormatter) EmojiFormat(name string, kind string) string

EmojiFormat format the name with the emoji

Jump to

Keyboard shortcuts

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