config

package
v1.9.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderRowNum ui header max row num
	HeaderRowNum = 7
	// FooterRowNum ui footer max row num
	FooterRowNum = 1
	// MenuRowNum menu component max row num
	MenuRowNum = 6
	// LogoColumnNum logo component max column num
	LogoColumnNum = 50
)

Variables

View Source
var (
	// ThemeConfigFS is the theme config file system.
	//go:embed theme/*
	ThemeConfigFS embed.FS
	// ThemeMap is the theme map.
	ThemeMap = make(map[string]ThemeConfig)
	// ThemeNameArray is the theme name array.
	ThemeNameArray []string
)

Functions

func PersistentThemeConfig added in v1.7.0

func PersistentThemeConfig(themeName string)

PersistentThemeConfig saves theme config to file

Types

type Color added in v1.7.0

type Color string

Color is a color string.

const (
	// DefaultColor represents a default color.
	DefaultColor Color = "default"
	// DefaultTheme represents a default theme.
	DefaultTheme = "default"
)

func (Color) Color added in v1.7.0

func (c Color) Color() tcell.Color

Color returns a view color.

func (Color) String added in v1.7.0

func (c Color) String() string

String returns color as string.

type Config

type Config struct {
	RestConfig *rest.Config
	Theme      *ThemeConfig
}

Config application configs

type ThemeConfig added in v1.7.0

type ThemeConfig struct {
	Info struct {
		Title Color
		Text  Color
	}
	Menu struct {
		Description Color
		Key         Color
	}
		Text Color
	}
	Crumbs struct {
		Foreground Color
		Background Color
	}
	Border struct {
		App   Color
		Table Color
	}
	Table struct {
		Title    Color
		Header   Color
		Body     Color
		CursorBg Color
		CursorFg Color
	}
	Status struct {
		Starting  Color
		Healthy   Color
		UnHealthy Color
		Waiting   Color
		Succeeded Color
		Failed    Color
		Unknown   Color
	}
	Yaml struct {
		Key   Color
		Colon Color
		Value Color
	}
	Topology struct {
		Line      Color
		App       Color
		Workflow  Color
		Component Color
		Policy    Color
		Trait     Color
		Kind      Color
	}
}

ThemeConfig is the theme config.

func LoadThemeConfig added in v1.7.0

func LoadThemeConfig() *ThemeConfig

LoadThemeConfig loads theme config from env or use the default setting

Jump to

Keyboard shortcuts

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