tui

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SymbolSuccess  = "✓"
	SymbolError    = "✗"
	SymbolWarning  = "⚠"
	SymbolInfo     = "ℹ"
	SymbolSelected = "▸"
	SymbolArrow    = "→"
	SymbolBullet   = "•"
	SymbolCheck    = "☑"
	SymbolUncheck  = "☐"
)

Symbols and icons

Variables

View Source
var (
	// Primary Proxmox color
	ProxmoxOrange = tcell.NewRGBColor(229, 112, 0) // #E57000

	// Neutral colors
	ProxmoxDark  = tcell.NewRGBColor(40, 40, 40)    // #282828
	ProxmoxGray  = tcell.NewRGBColor(128, 128, 128) // #808080
	ProxmoxLight = tcell.NewRGBColor(200, 200, 200) // #C8C8C8

	// Status colors
	SuccessGreen  = tcell.NewRGBColor(34, 197, 94)  // #22C55E
	ErrorRed      = tcell.NewRGBColor(239, 68, 68)  // #EF4444
	WarningYellow = tcell.NewRGBColor(234, 179, 8)  // #EAB308
	InfoBlue      = tcell.NewRGBColor(59, 130, 246) // #3B82F6

	// Additional UI colors
	White     = tcell.ColorWhite
	Black     = tcell.ColorBlack
	LightGray = tcell.ColorLightGray
	DarkGray  = tcell.ColorDarkGray
)

Proxmox color palette

Functions

func BuildScreen added in v0.17.0

func BuildScreen(spec ScreenSpec, content tview.Primitive) tview.Primitive

func SetAbortContext added in v0.12.6

func SetAbortContext(ctx context.Context)

SetAbortContext registers a process-wide context used to stop any running TUI app (tview) when the context is canceled (e.g. Ctrl+C).

This is intentionally global so all TUIs behave consistently without each wizard needing bespoke signal handling.

func StatusColor

func StatusColor(status string) tcell.Color

StatusColor returns the appropriate color for a status

func StatusSymbol

func StatusSymbol(status string) string

StatusSymbol returns the appropriate symbol for a status

Types

type App

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

App wraps tview.Application with Proxmox-specific configuration

func NewApp

func NewApp() *App

NewApp creates a new TUI application with Proxmox theme

func (*App) RunWithContext added in v0.17.0

func (a *App) RunWithContext(ctx context.Context) error

func (*App) SetRootWithTitle

func (a *App) SetRootWithTitle(root tview.Primitive, title string) *App

SetRootWithTitle sets the root primitive with a styled title

func (*App) Stop added in v0.12.7

func (a *App) Stop()

type ScreenSpec added in v0.17.0

type ScreenSpec struct {
	Title           string
	HeaderText      string
	NavText         string
	ConfigPath      string
	BuildSig        string
	TitleColor      tcell.Color
	BorderColor     tcell.Color
	BackgroundColor tcell.Color
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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