ui

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChartHistoryLength      = 200
	ChartUpdateInterval     = 2 * time.Second
	UserStatsUpdateInterval = 30 * time.Second
	ChartSlidingWindow      = int(time.Minute / ChartUpdateInterval)
)
View Source
const PanelHeight = 6
View Source
const StoppedPanelHeight = 2

Variables

View Source
var Colors = DefaultPalette()

Colors is the active palette. It is initialized with a default palette at package init and may be replaced by ApplyPalette after terminal color detection.

View Source
var Styles = buildStyles()

Functions

func ApplyPalette

func ApplyPalette(p *Palette)

ApplyPalette sets the package-level Colors variable and rebuilds all package-level style variables that depend on colors.

func NewKeyBinding

func NewKeyBinding(keys ...string) key.Binding

func OverlayCenter

func OverlayCenter(bg, fg string, width, height int) string

OverlayCenter composites fg centered on top of bg within the given dimensions.

func Run

func Run(ns *docker.Namespace, installImageRef string) error

func SlidingSum

func SlidingSum(data []float64, window int) []float64

SlidingSum computes the sum of each point and the preceding window-1 points. Missing values before the start of data are treated as zero. Returns same length as input.

func WithBackground

func WithBackground(bg color.Color, content string) string

WithBackground re-applies a background color after any SGR reset sequences within the content, so that inner styled elements don't clear the outer background. Resets with no visible content following on the same line are left alone, preventing the background from bleeding past the panel edge.

func WithHelp

func WithHelp(b key.Binding, k, desc string) key.Binding

Types

type ActionsMenu

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

func NewActionsMenu

func NewActionsMenu(app *docker.Application) ActionsMenu

func (ActionsMenu) Init

func (m ActionsMenu) Init() tea.Cmd

func (ActionsMenu) Update

func (m ActionsMenu) Update(msg tea.Msg) (Component, tea.Cmd)

func (ActionsMenu) View

func (m ActionsMenu) View() string

type ActionsMenuAction

type ActionsMenuAction int
const (
	ActionsMenuStartStop ActionsMenuAction = iota
	ActionsMenuRemove
)

type ActionsMenuCloseMsg

type ActionsMenuCloseMsg struct{}

type ActionsMenuSelectMsg

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

type App

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

func NewApp

func NewApp(ns *docker.Namespace, installImageRef string) *App

func (*App) Init

func (m *App) Init() tea.Cmd

func (*App) Update

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

func (*App) View

func (m *App) View() tea.View

type Chart

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

Chart renders a braille histogram with a vertical color gradient. The constructor takes static properties (title, unit) and View takes per-render values (data, width, height).

func NewChart

func NewChart(title string, unit UnitType) Chart

func (Chart) View

func (c Chart) View(data []float64, width, height int, scale ChartScale) string

View renders the chart as a string with a rounded border. The title is embedded in the top border line. Inner rows contain the braille chart with max-value and "0" labels on the first and last rows.

type ChartScale

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

func NewChartScale

func NewChartScale(unit UnitType, rawMax float64) ChartScale

func (ChartScale) Max

func (s ChartScale) Max() float64

type CheckboxField

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

func NewCheckboxField

func NewCheckboxField(label string, checked bool) *CheckboxField

func (*CheckboxField) Blur

func (f *CheckboxField) Blur()

func (*CheckboxField) Checked

func (f *CheckboxField) Checked() bool

func (*CheckboxField) Focus

func (f *CheckboxField) Focus() tea.Cmd

func (*CheckboxField) IsFocusable

func (f *CheckboxField) IsFocusable() bool

func (*CheckboxField) SetDisabledWhen

func (f *CheckboxField) SetDisabledWhen(fn func() (disabled bool, text string))

func (*CheckboxField) SetWidth

func (f *CheckboxField) SetWidth(int)

func (*CheckboxField) Toggle

func (f *CheckboxField) Toggle()

func (*CheckboxField) Update

func (f *CheckboxField) Update(msg tea.Msg) tea.Cmd

func (*CheckboxField) View

func (f *CheckboxField) View() string

type Component

type Component interface {
	Init() tea.Cmd
	Update(tea.Msg) (Component, tea.Cmd)
	View() string
}

Component is the interface for internal UI components. Only App satisfies tea.Model; sub-components use this narrower interface with plain string views.

type Confirmation

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

func NewConfirmation

func NewConfirmation(message, confirmLabel string) Confirmation

func (Confirmation) Update

func (m Confirmation) Update(msg tea.Msg) (Confirmation, tea.Cmd)

func (Confirmation) View

func (m Confirmation) View() string

type ConfirmationCancelMsg

type ConfirmationCancelMsg struct{}

type ConfirmationConfirmMsg

type ConfirmationConfirmMsg struct{}

type Dashboard

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

func NewDashboard

func NewDashboard(ns *docker.Namespace, apps []*docker.Application, selectedIndex int,
	scraper *metrics.MetricsScraper, dockerScraper *docker.Scraper, systemScraper *system.Scraper, userStats *userstats.Reader,
) Dashboard

func (Dashboard) Init

func (m Dashboard) Init() tea.Cmd

func (Dashboard) Update

func (m Dashboard) Update(msg tea.Msg) (Component, tea.Cmd)

func (Dashboard) View

func (m Dashboard) View() string

type DashboardHeader

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

func NewDashboardHeader

func NewDashboardHeader(scraper *system.Scraper) DashboardHeader

func (DashboardHeader) Height

func (h DashboardHeader) Height(width int) int

func (DashboardHeader) View

func (h DashboardHeader) View(width int) string

type DashboardPanel

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

func NewDashboardPanel

func NewDashboardPanel(app *docker.Application, scraper *metrics.MetricsScraper, dockerScraper *docker.Scraper, userStats *userstats.Reader) DashboardPanel

func (DashboardPanel) DataMaxes

func (p DashboardPanel) DataMaxes() (traffic float64)

func (DashboardPanel) Height

func (p DashboardPanel) Height(showDetails bool) int

func (DashboardPanel) View

func (p DashboardPanel) View(selected bool, toggling bool, showDetails bool, width int, scales DashboardScales) string

type DashboardScales

type DashboardScales struct {
	CPU, Memory ChartScale // fixed scales from host hardware
	Traffic     ChartScale // shared across panels
}

type DetectedColors

type DetectedColors struct {
	Colors   [sampleCount]colorful.Color
	Detected [sampleCount]bool
}

DetectedColors holds optional RGB values detected from the terminal.

func DetectTerminalColors

func DetectTerminalColors(timeout time.Duration) DetectedColors

DetectTerminalColors queries the terminal for foreground, background, and all 16 ANSI palette colors via OSC sequences. A DA1 request is appended as a sentinel. The function returns after all responses arrive, the DA1 sentinel is received, or the timeout expires.

func (DetectedColors) SupportsTrueColor

func (d DetectedColors) SupportsTrueColor() bool

SupportsTrueColor returns true if the terminal responded with RGB color values, implying it can also render them. SupportsTrueColor reports whether the terminal is likely to support 24-bit color output. COLORTERM is the authoritative signal; when it is absent (common over SSH), we infer support from successful OSC palette detection.

type Form

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

func NewForm

func NewForm(submitLabel string, items ...FormItem) Form

func (*Form) AppendItems

func (f *Form) AppendItems(items ...FormItem)

func (Form) CheckboxField

func (f Form) CheckboxField(i int) *CheckboxField

func (Form) Error

func (f Form) Error() string

func (Form) Field

func (f Form) Field(i int) FormField

func (Form) Focused

func (f Form) Focused() int

func (Form) HasError

func (f Form) HasError() bool

func (Form) Init

func (f Form) Init() tea.Cmd

func (Form) ItemCount

func (f Form) ItemCount() int

func (*Form) OnCancel

func (f *Form) OnCancel(fn func(f *Form) tea.Cmd)

func (*Form) OnRebuild

func (f *Form) OnRebuild(fn func(f *Form))

func (*Form) OnSubmit

func (f *Form) OnSubmit(fn func(f *Form) tea.Cmd)

func (*Form) SetActionButton

func (f *Form) SetActionButton(label string, onPress func() tea.Msg)

func (Form) TextField

func (f Form) TextField(i int) *TextField

func (Form) Update

func (f Form) Update(msg tea.Msg) (Form, tea.Cmd)

func (Form) View

func (f Form) View() string

type FormActionButton

type FormActionButton struct {
	Label   string
	OnPress func() tea.Msg
}

type FormActionMsg

type FormActionMsg struct{ Msg tea.Msg }

type FormCancelMsg

type FormCancelMsg struct{}

type FormField

type FormField interface {
	Update(tea.Msg) tea.Cmd
	View() string
	Focus() tea.Cmd
	Blur()
	SetWidth(int)
	IsFocusable() bool
}

type FormItem

type FormItem struct {
	Label    string
	Field    FormField
	Required bool
}

type FormSubmitMsg

type FormSubmitMsg struct{}

type HealthState

type HealthState int

func (HealthState) Color

func (h HealthState) Color() color.Color

type Help

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

func NewHelp

func NewHelp() Help

func (Help) Height

func (h Help) Height() int

func (*Help) SetBindings

func (h *Help) SetBindings(bindings []key.Binding)

func (*Help) SetWidth

func (h *Help) SetWidth(w int)

func (Help) Update

func (h Help) Update(msg tea.Msg) (Help, tea.Cmd)

func (Help) View

func (h Help) View() string

type Install

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

func NewInstall

func NewInstall(ns *docker.Namespace, imageRef string) Install

func (Install) Init

func (m Install) Init() tea.Cmd

func (Install) Update

func (m Install) Update(msg tea.Msg) (Component, tea.Cmd)

func (Install) View

func (m Install) View() string

type InstallActivity

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

func NewInstallActivity

func NewInstallActivity(ns *docker.Namespace, imageRef, hostname string) *InstallActivity

func (*InstallActivity) Cancel

func (m *InstallActivity) Cancel()

func (*InstallActivity) Init

func (m *InstallActivity) Init() tea.Cmd

func (*InstallActivity) Update

func (m *InstallActivity) Update(msg tea.Msg) tea.Cmd

func (*InstallActivity) View

func (m *InstallActivity) View() string

type InstallActivityDoneMsg

type InstallActivityDoneMsg struct {
	App *docker.Application
}

type InstallActivityFailedMsg

type InstallActivityFailedMsg struct {
	Err error
}

type InstallAppList

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

func NewInstallAppList

func NewInstallAppList() InstallAppList

func (InstallAppList) Init

func (m InstallAppList) Init() tea.Cmd

func (InstallAppList) Update

func (m InstallAppList) Update(msg tea.Msg) (InstallAppList, tea.Cmd)

func (InstallAppList) View

func (m InstallAppList) View() string

type InstallAppSelectedMsg

type InstallAppSelectedMsg struct{ ImageRef string }

type InstallCustomSelectedMsg

type InstallCustomSelectedMsg struct{}

type InstallFormSubmitMsg

type InstallFormSubmitMsg struct {
	ImageRef string
	Hostname string
}

type InstallHostnameBackMsg

type InstallHostnameBackMsg struct{}

type InstallHostnameForm

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

func NewInstallHostnameForm

func NewInstallHostnameForm(imageRef, title string) InstallHostnameForm

func (InstallHostnameForm) Hostname

func (m InstallHostnameForm) Hostname() string

func (InstallHostnameForm) Init

func (m InstallHostnameForm) Init() tea.Cmd

func (InstallHostnameForm) Update

func (InstallHostnameForm) View

func (m InstallHostnameForm) View() string

type InstallImageBackMsg

type InstallImageBackMsg struct{}

type InstallImageForm

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

func NewInstallImageForm

func NewInstallImageForm() InstallImageForm

func (InstallImageForm) Init

func (m InstallImageForm) Init() tea.Cmd

func (InstallImageForm) Update

func (m InstallImageForm) Update(msg tea.Msg) (InstallImageForm, tea.Cmd)

func (InstallImageForm) View

func (m InstallImageForm) View() string

type InstallImageSubmitMsg

type InstallImageSubmitMsg struct{ ImageRef string }

type KnownApp

type KnownApp struct {
	Name     string
	Alias    string
	ImageRef string
}
type Logo struct {
	// contains filtered or unexported fields
}
func NewLogo() *Logo

func (*Logo) Init

func (l *Logo) Init() tea.Cmd

func (*Logo) Update

func (l *Logo) Update(msg tea.Msg) tea.Cmd

func (*Logo) View

func (l *Logo) View() string

type Logs

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

func NewLogs

func NewLogs(ns *docker.Namespace, app *docker.Application) Logs

func (Logs) Init

func (m Logs) Init() tea.Cmd

func (Logs) Update

func (m Logs) Update(msg tea.Msg) (Component, tea.Cmd)

func (Logs) View

func (m Logs) View() string
type Menu struct {
	// contains filtered or unexported fields
}

func NewMenu

func NewMenu(items ...MenuItem) Menu
func (m *Menu) SetWidth(w int)
func (m Menu) Update(msg tea.Msg) (Menu, tea.Cmd)
func (m Menu) View() string
type MenuItem struct {
	Label    string
	Key      int
	Shortcut key.Binding
}
type MenuSelectMsg struct{ Key int }

type MetricCard

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

func NewMetricCard

func NewMetricCard(title string, data []float64, scale ChartScale, unit UnitType, limitLabel string, warning, error float64) MetricCard

func NewTrafficCard

func NewTrafficCard(reqData, errData []float64, scale ChartScale, errPct float64, warning, error float64) MetricCard

func (MetricCard) Health

func (c MetricCard) Health() HealthState

func (MetricCard) View

func (c MetricCard) View(width int) string

type MetricThresholds

type MetricThresholds struct {
	Warning float64
	Error   float64
}

func (MetricThresholds) Color

func (t MetricThresholds) Color(pct float64) color.Color

func (MetricThresholds) Health

func (t MetricThresholds) Health(pct float64) HealthState

type MouseEvent

type MouseEvent struct {
	X, Y    int
	Button  tea.MouseButton
	Target  string
	IsClick bool
}

MouseEvent is dispatched to sub-components after the root App resolves mouse coordinates against the mouse tracker's zone map.

type NavigateToAppMsg struct{ App *docker.Application }
type NavigateToDashboardMsg struct {
	AppName    string
	AllowEmpty bool
}
type NavigateToInstallMsg struct{}
type NavigateToLogsMsg struct{ App *docker.Application }
type NavigateToRemoveMsg struct{ App *docker.Application }
type NavigateToSettingsSectionMsg struct {
	App     *docker.Application
	Section SettingsSectionType
}

type Palette

type Palette struct {
	// ANSI 16 — always BasicColor values for rendering
	Black, Red, Green, Yellow, Blue, Magenta, Cyan, White                                                 color.Color
	BrightBlack, BrightRed, BrightGreen, BrightYellow, BrightBlue, BrightMagenta, BrightCyan, BrightWhite color.Color

	// Synthesized (always true-color RGB)
	FocusOrange    color.Color
	BackgroundTint color.Color
	LightText      color.Color

	// Semantic aliases
	Border  color.Color // = LightText
	Muted   color.Color // = LightText
	Focused color.Color // = FocusOrange
	Primary color.Color // = Blue or BrightBlue (better contrast)
	Error   color.Color // = Red
	Success color.Color // = Green
	Warning color.Color // = FocusOrange
	// contains filtered or unexported fields
}

Palette holds all colors used by the UI. ANSI color fields always contain BasicColor values so the terminal applies its own theme. Synthesized colors (FocusOrange, BackgroundTint, LightText) are true-color RGB.

func DefaultPalette

func DefaultPalette() *Palette

DefaultPalette returns a palette with ANSI BasicColor values and fallback-derived synthesized colors. This is the package-init value.

func NewPalette

func NewPalette(detected DetectedColors) *Palette

NewPalette creates a palette from detected terminal colors.

func (*Palette) Gradient

func (p *Palette) Gradient(t float64) color.Color

Gradient interpolates between green and FocusOrange in OKLCH. t=0 returns green, t=1 returns orange.

func (*Palette) HealthColor

func (p *Palette) HealthColor(h HealthState) color.Color

HealthColor returns the palette color for the given health state.

type PopupHelp

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

func NewPopupHelp

func NewPopupHelp(title, content string, termWidth, termHeight int) PopupHelp

func (PopupHelp) Update

func (m PopupHelp) Update(msg tea.Msg) (PopupHelp, tea.Cmd)

func (PopupHelp) View

func (m PopupHelp) View() string

type PopupHelpCloseMsg

type PopupHelpCloseMsg struct{}

type Progress

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

func NewProgress

func NewProgress(width int, clr color.Color) Progress

func (Progress) Init

func (p Progress) Init() tea.Cmd

func (Progress) SetPercent

func (p Progress) SetPercent(pct int) Progress

func (Progress) SetWidth

func (p Progress) SetWidth(w int) Progress

func (Progress) Update

func (p Progress) Update(msg tea.Msg) (Progress, tea.Cmd)

func (Progress) View

func (p Progress) View() string

type ProgressTickMsg

type ProgressTickMsg struct{}

type QuitMsg

type QuitMsg struct{}

type Remove

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

func NewRemove

func NewRemove(ns *docker.Namespace, app *docker.Application) Remove

func (Remove) Init

func (m Remove) Init() tea.Cmd

func (Remove) Update

func (m Remove) Update(msg tea.Msg) (Component, tea.Cmd)

func (Remove) View

func (m Remove) View() string

type Settings

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

func NewSettings

func NewSettings(ns *docker.Namespace, app *docker.Application, sectionType SettingsSectionType) Settings

func (Settings) Init

func (m Settings) Init() tea.Cmd

func (Settings) Update

func (m Settings) Update(msg tea.Msg) (Component, tea.Cmd)

func (Settings) View

func (m Settings) View() string

type SettingsFormApplication

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

func NewSettingsFormApplication

func NewSettingsFormApplication(settings docker.ApplicationSettings) SettingsFormApplication

func (SettingsFormApplication) Init

func (b SettingsFormApplication) Init() tea.Cmd

func (SettingsFormApplication) StatusLine

func (b SettingsFormApplication) StatusLine() string

func (SettingsFormApplication) Title

func (b SettingsFormApplication) Title() string

func (SettingsFormApplication) Update

func (SettingsFormApplication) View

func (b SettingsFormApplication) View() string

type SettingsFormBackups

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

func NewSettingsFormBackups

func NewSettingsFormBackups(app *docker.Application, lastResult *docker.OperationResult) SettingsFormBackups

func (SettingsFormBackups) Init

func (b SettingsFormBackups) Init() tea.Cmd

func (SettingsFormBackups) StatusLine

func (b SettingsFormBackups) StatusLine() string

func (SettingsFormBackups) Title

func (b SettingsFormBackups) Title() string

func (SettingsFormBackups) Update

func (m SettingsFormBackups) Update(msg tea.Msg) (SettingsSection, tea.Cmd)

func (SettingsFormBackups) View

func (b SettingsFormBackups) View() string

type SettingsFormEmail

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

func NewSettingsFormEmail

func NewSettingsFormEmail(settings docker.ApplicationSettings) SettingsFormEmail

func (SettingsFormEmail) Init

func (b SettingsFormEmail) Init() tea.Cmd

func (SettingsFormEmail) StatusLine

func (b SettingsFormEmail) StatusLine() string

func (SettingsFormEmail) Title

func (b SettingsFormEmail) Title() string

func (SettingsFormEmail) Update

func (m SettingsFormEmail) Update(msg tea.Msg) (SettingsSection, tea.Cmd)

func (SettingsFormEmail) View

func (b SettingsFormEmail) View() string

type SettingsFormEnvironment

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

func NewSettingsFormEnvironment

func NewSettingsFormEnvironment(settings docker.ApplicationSettings) SettingsFormEnvironment

func (SettingsFormEnvironment) Init

func (b SettingsFormEnvironment) Init() tea.Cmd

func (SettingsFormEnvironment) StatusLine

func (b SettingsFormEnvironment) StatusLine() string

func (SettingsFormEnvironment) Title

func (b SettingsFormEnvironment) Title() string

func (SettingsFormEnvironment) Update

func (SettingsFormEnvironment) View

type SettingsFormResources

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

func NewSettingsFormResources

func NewSettingsFormResources(settings docker.ApplicationSettings) SettingsFormResources

func (SettingsFormResources) Init

func (b SettingsFormResources) Init() tea.Cmd

func (SettingsFormResources) StatusLine

func (b SettingsFormResources) StatusLine() string

func (SettingsFormResources) Title

func (b SettingsFormResources) Title() string

func (SettingsFormResources) Update

func (SettingsFormResources) View

func (b SettingsFormResources) View() string

type SettingsFormUpdates

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

func NewSettingsFormUpdates

func NewSettingsFormUpdates(app *docker.Application, lastResult *docker.OperationResult) SettingsFormUpdates

func (SettingsFormUpdates) Init

func (b SettingsFormUpdates) Init() tea.Cmd

func (SettingsFormUpdates) StatusLine

func (b SettingsFormUpdates) StatusLine() string

func (SettingsFormUpdates) Title

func (b SettingsFormUpdates) Title() string

func (SettingsFormUpdates) Update

func (m SettingsFormUpdates) Update(msg tea.Msg) (SettingsSection, tea.Cmd)

func (SettingsFormUpdates) View

func (b SettingsFormUpdates) View() string

type SettingsMenu

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

func NewSettingsMenu

func NewSettingsMenu(app *docker.Application) SettingsMenu

func (SettingsMenu) Init

func (m SettingsMenu) Init() tea.Cmd

func (SettingsMenu) Update

func (m SettingsMenu) Update(msg tea.Msg) (Component, tea.Cmd)

func (SettingsMenu) View

func (m SettingsMenu) View() string

type SettingsMenuCloseMsg

type SettingsMenuCloseMsg struct{}

type SettingsMenuSelectMsg

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

type SettingsSection

type SettingsSection interface {
	Init() tea.Cmd
	Update(tea.Msg) (SettingsSection, tea.Cmd)
	View() string
	Title() string
	StatusLine() string
}

type SettingsSectionCancelMsg

type SettingsSectionCancelMsg struct{}

type SettingsSectionSubmitMsg

type SettingsSectionSubmitMsg struct {
	Settings docker.ApplicationSettings
}

type SettingsSectionType

type SettingsSectionType int
const (
	SettingsSectionApplication SettingsSectionType = iota
	SettingsSectionEmail
	SettingsSectionEnvironment
	SettingsSectionResources
	SettingsSectionUpdates
	SettingsSectionBackups
)

type Starfield

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

func NewStarfield

func NewStarfield() *Starfield

func (*Starfield) ComputeGrid

func (s *Starfield) ComputeGrid()

ComputeGrid projects all stars onto the cell grid. Must be called before RenderRow.

func (*Starfield) Init

func (s *Starfield) Init() tea.Cmd

func (*Starfield) RenderFullRow

func (s *Starfield) RenderFullRow(row int) string

RenderFullRow renders a full-width starfield row.

func (*Starfield) RenderRow

func (s *Starfield) RenderRow(row, fromCol, toCol int) string

RenderRow renders starfield cells for columns [fromCol, toCol) on the given row.

func (*Starfield) Update

func (s *Starfield) Update(msg tea.Msg) tea.Cmd

type StaticField

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

func NewStaticField

func NewStaticField(value string, styleFn func(string) string) *StaticField

func (*StaticField) Blur

func (f *StaticField) Blur()

func (*StaticField) Focus

func (f *StaticField) Focus() tea.Cmd

func (*StaticField) IsFocusable

func (f *StaticField) IsFocusable() bool

func (*StaticField) SetValue

func (f *StaticField) SetValue(v string)

func (*StaticField) SetWidth

func (f *StaticField) SetWidth(int)

func (*StaticField) Update

func (f *StaticField) Update(tea.Msg) tea.Cmd

func (*StaticField) Value

func (f *StaticField) Value() string

func (*StaticField) View

func (f *StaticField) View() string

type TerminalSizeGuard

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

func NewTerminalSizeGuard

func NewTerminalSizeGuard(minWidth, minHeight int) TerminalSizeGuard

func (TerminalSizeGuard) LargeEnough

func (g TerminalSizeGuard) LargeEnough() bool

func (TerminalSizeGuard) Update

func (TerminalSizeGuard) View

func (g TerminalSizeGuard) View() string

type TextField

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

func NewTextField

func NewTextField(placeholder string) *TextField

func (*TextField) Blur

func (f *TextField) Blur()

func (*TextField) Focus

func (f *TextField) Focus() tea.Cmd

func (*TextField) IsFocusable

func (f *TextField) IsFocusable() bool

func (*TextField) SetCharLimit

func (f *TextField) SetCharLimit(n int)

func (*TextField) SetDigitsOnly

func (f *TextField) SetDigitsOnly(v bool)

func (*TextField) SetEchoPassword

func (f *TextField) SetEchoPassword()

func (*TextField) SetPlaceholder

func (f *TextField) SetPlaceholder(p string)

func (*TextField) SetValue

func (f *TextField) SetValue(v string)

func (*TextField) SetWidth

func (f *TextField) SetWidth(w int)

func (*TextField) Update

func (f *TextField) Update(msg tea.Msg) tea.Cmd

func (*TextField) Value

func (f *TextField) Value() string

func (*TextField) View

func (f *TextField) View() string

type UnitType

type UnitType int
const (
	UnitCount   UnitType = iota // 1K, 1M (requests, errors)
	UnitPercent                 // 50.0%
	UnitBytes                   // 128 MiB, 1.5 GiB
)

func (UnitType) Format

func (u UnitType) Format(value float64) string

Jump to

Keyboard shortcuts

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