tui

package
v0.0.61 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppTheme

type AppTheme struct {
	Primary    string // Main brand color (vibrant green)
	Secondary  string // Complementary color
	Accent     string // Accent color for highlights
	Text       string // Default text color
	Subtle     string // Subtle text color
	Error      string // Error color
	Warning    string // Warning color
	Success    string // Success color
	Background string // Background color
	Surface    string // Surface color for UI elements
}

AppTheme holds the color theme for the application

func DefaultTheme

func DefaultTheme() AppTheme

DefaultTheme returns the default color theme

type ApplicationState

type ApplicationState int

ApplicationState represents the current state of the application

const (
	StateWelcome ApplicationState = iota
	StateCheckK3s
	StateConfirmUninstallK3s
	StateUninstallingK3s
	StateDebugLogs
	StateLoading
	StateRootDetection
	StateOSInfo
	StateCheckingSwap
	StateConfirmCreateSwap
	StateEnterSwapSize
	StateCreatingSwap
	StateSwapCreated
	StateInstallingPackages
	StateInstallComplete
	StateError
	StateDetectingIPs
	StateDNSConfig
	StateDNSValidation
	StateDNSSuccess
	StateDNSFailed
	StateRegistryTypeSelection
	StateRegistryDomainInput
	StateRegistryDNSValidation
	StateExternalRegistryInput
	StateExternalRegistryValidation
	StateInstallingK3S
	StateInstallingUnbind
	StateInstallationComplete
)

type Model

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

Model represents the application state

func NewModel

func NewModel(version string) Model

NewModel initializes a new Model

func (Model) Init

func (self Model) Init() tea.Cmd

Init is the Bubble Tea initialization function

func (Model) Update

func (self Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and user input

func (Model) View

func (self Model) View() string

View delegates to the appropriate view function based on state

type RegistryType added in v0.0.21

type RegistryType int

Registry type enum

const (
	RegistrySelfHosted RegistryType = iota // Self-hosted registry
	RegistryExternal                       // External registry like Docker Hub
)

type Styles

type Styles struct {
	Title           lipgloss.Style
	Normal          lipgloss.Style
	Bold            lipgloss.Style
	Subtle          lipgloss.Style
	Warning         lipgloss.Style
	Error           lipgloss.Style
	StatusBar       lipgloss.Style
	Key             lipgloss.Style
	SpinnerStyle    lipgloss.Style
	Success         lipgloss.Style
	HighlightButton lipgloss.Style
	SelectedOption  lipgloss.Style
}

Styles contains the styling for the UI

func NewStyles

func NewStyles(theme AppTheme) Styles

NewStyles initializes the application styles with the provided theme

func (Styles) NewThemedProgress

func (s Styles) NewThemedProgress(width int) progress.Model

Add a method to create a themed progress bar to the Styles struct

Jump to

Keyboard shortcuts

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