Help us shape the future of Go! Take the 2026 Go Developer Survey

ui

package
v1.0.41 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Colors
	ColorPrimary   = lipgloss.Color("#7C3AED") // Purple
	ColorSuccess   = lipgloss.Color("#10B981") // Green
	ColorWarning   = lipgloss.Color("#F59E0B") // Amber
	ColorDanger    = lipgloss.Color("#EF4444") // Red
	ColorInfo      = lipgloss.Color("#3B82F6") // Blue
	ColorMuted     = lipgloss.Color("#6B7280") // Gray
	ColorHighlight = lipgloss.Color("#F3F4F6")

	// Base styles
	Bold   = lipgloss.NewStyle().Bold(true)
	Italic = lipgloss.NewStyle().Italic(true)
	Muted  = lipgloss.NewStyle().Foreground(ColorMuted)

	// Status styles
	Success = lipgloss.NewStyle().Foreground(ColorSuccess).Bold(true)
	Warning = lipgloss.NewStyle().Foreground(ColorWarning).Bold(true)
	Danger  = lipgloss.NewStyle().Foreground(ColorDanger).Bold(true)
	Info    = lipgloss.NewStyle().Foreground(ColorInfo).Bold(true)

	// Title / Header
	Title = lipgloss.NewStyle().
			Bold(true).
			Foreground(ColorPrimary).
			PaddingTop(1).
			PaddingBottom(1)

	Subtitle = lipgloss.NewStyle().
				Foreground(ColorMuted).
				Italic(true)

	Banner = lipgloss.NewStyle().
			Border(lipgloss.RoundedBorder()).
			BorderForeground(ColorPrimary).
			Padding(0, 2).
			Bold(true).
			Foreground(ColorPrimary)

	// Section header
	SectionHeader = lipgloss.NewStyle().
					Bold(true).
					Foreground(ColorHighlight).
					Background(ColorPrimary).
					Padding(0, 1).
					MarginTop(1).
					MarginBottom(1)

	// Table styles
	TableHeader = lipgloss.NewStyle().
				Bold(true).
				Foreground(ColorPrimary).
				BorderBottom(true).
				BorderStyle(lipgloss.NormalBorder()).
				BorderForeground(ColorMuted)

	TableRow = lipgloss.NewStyle().
				PaddingLeft(1)

	TableRowAlt = lipgloss.NewStyle().
				PaddingLeft(1).
				Foreground(ColorMuted)

	// Status indicators
	StatusOK      = "✅"
	StatusFail    = "❌"
	StatusWarn    = "⚠️ "
	StatusRunning = "🔄"
	StatusPending = "⏳"

	// Box for info
	InfoBox = lipgloss.NewStyle().
			Border(lipgloss.RoundedBorder()).
			BorderForeground(ColorInfo).
			Padding(0, 1)

	// Box for warning
	WarnBox = lipgloss.NewStyle().
			Border(lipgloss.RoundedBorder()).
			BorderForeground(ColorWarning).
			Padding(0, 1)

	// Box for error
	ErrorBox = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(ColorDanger).
				Padding(0, 1)

	// Box for success
	SuccessBox = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(ColorSuccess).
				Padding(0, 1)
)

Functions

func RenderError

func RenderError(msg string) string

func RenderInfo

func RenderInfo(msg string) string

func RenderStep

func RenderStep(step int, total int, msg string) string

func RenderSuccess

func RenderSuccess(msg string) string

Render helpers

func RenderWarning

func RenderWarning(msg string) string

Types

type ClusterData

type ClusterData struct {
	Nodes    []NodeRow
	Services []ServiceRow
	Error    string
}

type DashboardModel

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

func NewDashboard

func NewDashboard(clusterName, masterIP string, fetchFn func() ClusterData) DashboardModel

func (DashboardModel) Init

func (m DashboardModel) Init() tea.Cmd

func (DashboardModel) Update

func (m DashboardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (DashboardModel) View

func (m DashboardModel) View() string

type NodeRow

type NodeRow struct {
	Hostname     string
	Status       string
	Role         string
	CPU          string
	Memory       string
	Availability string
}

type ServiceRow

type ServiceRow struct {
	Name     string
	Mode     string
	Replicas string
	Image    string
	Healthy  bool
}

Jump to

Keyboard shortcuts

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