config

package
v1.9.12 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 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 `yaml:"title"`
		Text  Color `yaml:"text"`
	} `yaml:"info"`
	Menu struct {
		Description Color `yaml:"description"`
		Key         Color `yaml:"key"`
	} `yaml:"menu"`
		Text Color `yaml:"text"`
	} `yaml:"logo"`
	Crumbs struct {
		Foreground Color `yaml:"foreground"`
		Background Color `yaml:"background"`
	} `yaml:"crumbs"`
	Border struct {
		App   Color `yaml:"app"`
		Table Color `yaml:"table"`
	} `yaml:"border"`
	Table struct {
		Title    Color `yaml:"title"`
		Header   Color `yaml:"header"`
		Body     Color `yaml:"body"`
		CursorBg Color `yaml:"cursorbg"`
		CursorFg Color `yaml:"cursorfg"`
	} `yaml:"table"`
	Status struct {
		Starting  Color `yaml:"starting"`
		Healthy   Color `yaml:"healthy"`
		UnHealthy Color `yaml:"unhealthy"`
		Waiting   Color `yaml:"waiting"`
		Succeeded Color `yaml:"succeeded"`
		Failed    Color `yaml:"failed"`
		Unknown   Color `yaml:"unknown"`
	} `yaml:"status"`
	Yaml struct {
		Key   Color `yaml:"key"`
		Colon Color `yaml:"colon"`
		Value Color `yaml:"value"`
	} `yaml:"yaml"`
	Topology struct {
		Line      Color `yaml:"line"`
		App       Color `yaml:"app"`
		Workflow  Color `yaml:"workflow"`
		Component Color `yaml:"component"`
		Policy    Color `yaml:"policy"`
		Trait     Color `yaml:"trait"`
		Kind      Color `yaml:"kind"`
	} `yaml:"topology"`
}

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