gui

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TsLayout = "2006-01-02T15:04:05"

	MainPage                   = "main"
	LogConfigDetailPage        = "logConfigDetail"
	LogConfigListPage          = "logConfigList"
	YamlDetailPage             = "logConfigYamlDetail"
	ClusterLogConfigListPage   = "clusterLogConfigList"
	ClusterLogConfigDetailPage = "clusterLogConfigDetail"
	LoggieDetailPage           = "loggieDetail"
	LoggieListPage             = "loggieList"
	LoggieLogsPage             = "loggieLogs"
	LoggieProgressPage         = "loggieProgress"
)
View Source
const (
	ColorSelectedForeground = tcell.ColorBlack

	ColorGreen  = tcell.ColorGreen
	ColorTeal   = tcell.ColorTeal
	ColorWhite  = tcell.ColorWhite
	ColorRed    = tcell.ColorRed
	ColorYellow = tcell.ColorYellow

	ColorTextWhite  = "[white]"
	ColorTextPurple = "[purple]"
	ColorTextTeal   = "[teal]"
)

Considering that different terminals support limited colors, only the most common colors are used here

View Source
const (
	KeyTab    = "tab"
	KeyJ      = "down"
	KeyK      = "up"
	KeyEnter  = "enter"
	KeyQ      = "quit"
	KeyF      = "filter"
	KeyR      = "refresh"
	KeyO      = "show all"
	KeyL      = "logs"
	KeyCtrlF  = "page down"
	KeyCtrlB  = "page up"
	KeyG      = "home"
	KeyShiftG = "end"
)

Variables

This section is empty.

Functions

func KeyNavFmt

func KeyNavFmt(key string, info string) string

func NewTableSelectedStyle

func NewTableSelectedStyle(color tcell.Color) tcell.Style

func TableFocus

func TableFocus(table *tview.Table, gui *Gui, color tcell.Color)

func TableUnFocus

func TableUnFocus(table *tview.Table)

func TextViewFocus

func TextViewFocus(t *tview.TextView, gui *Gui, color tcell.Color)

func TextViewUnFocus

func TextViewUnFocus(t *tview.TextView)

Types

type Config

type Config struct {
	LoggiePort int
	KubeConfig string
}

type Gui

type Gui struct {
	App   *tview.Application
	Pages *tview.Pages

	Nav *Navigate

	K8sClient *K8sClient

	Config *Config

	GlobalStat Stat
	// contains filtered or unexported fields
}

func New

func New(config *Config) *Gui

func (*Gui) AddPanels

func (g *Gui) AddPanels(page string, pa ...Panel)

func (*Gui) CloseAndSwitchPanel

func (g *Gui) CloseAndSwitchPanel(removePage string, lastPage string, switchPanel string)

func (*Gui) CurrentPanel

func (g *Gui) CurrentPanel() Panel

func (*Gui) GetLoggieAgentPod

func (g *Gui) GetLoggieAgentPod(node string) *corev1.Pod

func (*Gui) NextPanel

func (g *Gui) NextPanel()

func (*Gui) PrevPanel

func (g *Gui) PrevPanel()

func (*Gui) SetCurrentPage

func (g *Gui) SetCurrentPage(page string)

func (*Gui) SetGlobalKeybinding

func (g *Gui) SetGlobalKeybinding(event *tcell.EventKey)

func (*Gui) SetLoggieAgentList

func (g *Gui) SetLoggieAgentList(pod *corev1.PodList)

func (*Gui) Start

func (g *Gui) Start() error

func (*Gui) Stop

func (g *Gui) Stop()

func (*Gui) SwitchPanel

func (g *Gui) SwitchPanel(panelName string)

type K8sClient

type K8sClient struct {
	KubeClient    *kubeclientset.Clientset
	LgcClient     *logconfigclientset.Clientset
	MetricsClient *metricsv.Clientset
}
type Navigate struct {
	*tview.TextView
	// contains filtered or unexported fields
}
func (n *Navigate) AddKeyBindingsNavWithKey(panel string, extra string, keys ...string)

type Panel

type Panel interface {
	Name() string
	SetData()
	UpdateData(*Gui)
	SetKeybinding(*Gui)
	Focus()
	UnFocus()
	SetFilterWord(string)
}

type Panels

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

type Stat

type Stat struct {
	K8sVersion    string
	LoggieVersion string

	LogConfigCount        int
	ClusterLogConfigCount int
	InterceptorCount      int
	SinkCount             int

	LoggiePodCount int
	K8sNodeCount   int
}

Jump to

Keyboard shortcuts

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