Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyPalette(p *Palette)
- func NewKeyBinding(keys ...string) key.Binding
- func OverlayCenter(bg, fg string, width, height int) string
- func Run(ns *docker.Namespace, installImageRef string) error
- func SlidingSum(data []float64, window int) []float64
- func WithBackground(bg color.Color, content string) string
- func WithHelp(b key.Binding, k, desc string) key.Binding
- type ActionsMenu
- type ActionsMenuAction
- type ActionsMenuCloseMsg
- type ActionsMenuSelectMsg
- type App
- type Chart
- type ChartScale
- type CheckboxField
- func (f *CheckboxField) Blur()
- func (f *CheckboxField) Checked() bool
- func (f *CheckboxField) Focus() tea.Cmd
- func (f *CheckboxField) IsFocusable() bool
- func (f *CheckboxField) SetDisabledWhen(fn func() (disabled bool, text string))
- func (f *CheckboxField) SetWidth(int)
- func (f *CheckboxField) Toggle()
- func (f *CheckboxField) Update(msg tea.Msg) tea.Cmd
- func (f *CheckboxField) View() string
- type Component
- type Confirmation
- type ConfirmationCancelMsg
- type ConfirmationConfirmMsg
- type Dashboard
- type DashboardHeader
- type DashboardPanel
- type DashboardScales
- type DetectedColors
- type Form
- func (f *Form) AppendItems(items ...FormItem)
- func (f Form) CheckboxField(i int) *CheckboxField
- func (f Form) Error() string
- func (f Form) Field(i int) FormField
- func (f Form) Focused() int
- func (f Form) HasError() bool
- func (f Form) Init() tea.Cmd
- func (f Form) ItemCount() int
- func (f *Form) OnCancel(fn func(f *Form) tea.Cmd)
- func (f *Form) OnRebuild(fn func(f *Form))
- func (f *Form) OnSubmit(fn func(f *Form) tea.Cmd)
- func (f *Form) SetActionButton(label string, onPress func() tea.Msg)
- func (f Form) TextField(i int) *TextField
- func (f Form) Update(msg tea.Msg) (Form, tea.Cmd)
- func (f Form) View() string
- type FormActionButton
- type FormActionMsg
- type FormCancelMsg
- type FormField
- type FormItem
- type FormSubmitMsg
- type HealthState
- type Help
- type Install
- type InstallActivity
- type InstallActivityDoneMsg
- type InstallActivityFailedMsg
- type InstallAppList
- type InstallAppSelectedMsg
- type InstallCustomSelectedMsg
- type InstallFormSubmitMsg
- type InstallHostnameBackMsg
- type InstallHostnameForm
- type InstallImageBackMsg
- type InstallImageForm
- type InstallImageSubmitMsg
- type KnownApp
- type Logo
- type Logs
- type Menu
- type MenuItem
- type MenuSelectMsg
- type MetricCard
- type MetricThresholds
- type MouseEvent
- type NavigateToAppMsg
- type NavigateToDashboardMsg
- type NavigateToInstallMsg
- type NavigateToLogsMsg
- type NavigateToRemoveMsg
- type NavigateToSettingsSectionMsg
- type Palette
- type PopupHelp
- type PopupHelpCloseMsg
- type Progress
- type ProgressTickMsg
- type QuitMsg
- type Remove
- type Settings
- type SettingsFormApplication
- type SettingsFormBackups
- type SettingsFormEmail
- type SettingsFormEnvironment
- type SettingsFormResources
- type SettingsFormUpdates
- type SettingsMenu
- type SettingsMenuCloseMsg
- type SettingsMenuSelectMsg
- type SettingsSection
- type SettingsSectionCancelMsg
- type SettingsSectionSubmitMsg
- type SettingsSectionType
- type Starfield
- type StaticField
- func (f *StaticField) Blur()
- func (f *StaticField) Focus() tea.Cmd
- func (f *StaticField) IsFocusable() bool
- func (f *StaticField) SetValue(v string)
- func (f *StaticField) SetWidth(int)
- func (f *StaticField) Update(tea.Msg) tea.Cmd
- func (f *StaticField) Value() string
- func (f *StaticField) View() string
- type TerminalSizeGuard
- type TextField
- func (f *TextField) Blur()
- func (f *TextField) Focus() tea.Cmd
- func (f *TextField) IsFocusable() bool
- func (f *TextField) SetCharLimit(n int)
- func (f *TextField) SetDigitsOnly(v bool)
- func (f *TextField) SetEchoPassword()
- func (f *TextField) SetPlaceholder(p string)
- func (f *TextField) SetValue(v string)
- func (f *TextField) SetWidth(w int)
- func (f *TextField) Update(msg tea.Msg) tea.Cmd
- func (f *TextField) Value() string
- func (f *TextField) View() string
- type UnitType
Constants ¶
const ( ChartHistoryLength = 200 ChartUpdateInterval = 2 * time.Second UserStatsUpdateInterval = 30 * time.Second ChartSlidingWindow = int(time.Minute / ChartUpdateInterval) )
const PanelHeight = 6
const StoppedPanelHeight = 2
Variables ¶
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.
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 OverlayCenter ¶
OverlayCenter composites fg centered on top of bg within the given dimensions.
func SlidingSum ¶
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 ¶
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.
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) 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 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).
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) View ¶
func (f *CheckboxField) View() string
type Component ¶
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 ¶
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 ¶
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 (*Form) AppendItems ¶
func (Form) CheckboxField ¶
func (f Form) CheckboxField(i int) *CheckboxField
type FormActionButton ¶
type FormActionMsg ¶
type FormCancelMsg ¶
type FormCancelMsg struct{}
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 (*Help) SetBindings ¶
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) 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 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 (m InstallHostnameForm) Update(msg tea.Msg) (InstallHostnameForm, tea.Cmd)
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 MenuSelectMsg ¶
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 ¶
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 ¶
type NavigateToDashboardMsg ¶
type NavigateToDashboardMsg struct {
}
type NavigateToInstallMsg ¶
type NavigateToInstallMsg struct{}
type NavigateToLogsMsg ¶
type NavigateToRemoveMsg ¶
type NavigateToSettingsSectionMsg ¶
type NavigateToSettingsSectionMsg struct {
}
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 ¶
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 ¶
type PopupHelpCloseMsg ¶
type PopupHelpCloseMsg struct{}
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
func (Progress) SetPercent ¶
type ProgressTickMsg ¶
type ProgressTickMsg struct{}
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
func NewSettings ¶
func NewSettings(ns *docker.Namespace, app *docker.Application, sectionType SettingsSectionType) Settings
type SettingsFormApplication ¶
type SettingsFormApplication struct {
// contains filtered or unexported fields
}
func NewSettingsFormApplication ¶
func NewSettingsFormApplication(settings docker.ApplicationSettings) SettingsFormApplication
func (SettingsFormApplication) StatusLine ¶
func (b SettingsFormApplication) StatusLine() string
func (SettingsFormApplication) Update ¶
func (m SettingsFormApplication) Update(msg tea.Msg) (SettingsSection, tea.Cmd)
type SettingsFormBackups ¶
type SettingsFormBackups struct {
// contains filtered or unexported fields
}
func NewSettingsFormBackups ¶
func NewSettingsFormBackups(app *docker.Application, lastResult *docker.OperationResult) SettingsFormBackups
func (SettingsFormBackups) StatusLine ¶
func (b SettingsFormBackups) StatusLine() string
func (SettingsFormBackups) Update ¶
func (m SettingsFormBackups) Update(msg tea.Msg) (SettingsSection, tea.Cmd)
type SettingsFormEmail ¶
type SettingsFormEmail struct {
// contains filtered or unexported fields
}
func NewSettingsFormEmail ¶
func NewSettingsFormEmail(settings docker.ApplicationSettings) SettingsFormEmail
func (SettingsFormEmail) StatusLine ¶
func (b SettingsFormEmail) StatusLine() string
func (SettingsFormEmail) Update ¶
func (m SettingsFormEmail) Update(msg tea.Msg) (SettingsSection, tea.Cmd)
type SettingsFormEnvironment ¶
type SettingsFormEnvironment struct {
// contains filtered or unexported fields
}
func NewSettingsFormEnvironment ¶
func NewSettingsFormEnvironment(settings docker.ApplicationSettings) SettingsFormEnvironment
func (SettingsFormEnvironment) StatusLine ¶
func (b SettingsFormEnvironment) StatusLine() string
func (SettingsFormEnvironment) Update ¶
func (m SettingsFormEnvironment) Update(msg tea.Msg) (SettingsSection, tea.Cmd)
func (SettingsFormEnvironment) View ¶
func (m SettingsFormEnvironment) View() string
type SettingsFormResources ¶
type SettingsFormResources struct {
// contains filtered or unexported fields
}
func NewSettingsFormResources ¶
func NewSettingsFormResources(settings docker.ApplicationSettings) SettingsFormResources
func (SettingsFormResources) StatusLine ¶
func (b SettingsFormResources) StatusLine() string
func (SettingsFormResources) Update ¶
func (m SettingsFormResources) Update(msg tea.Msg) (SettingsSection, tea.Cmd)
type SettingsFormUpdates ¶
type SettingsFormUpdates struct {
// contains filtered or unexported fields
}
func NewSettingsFormUpdates ¶
func NewSettingsFormUpdates(app *docker.Application, lastResult *docker.OperationResult) SettingsFormUpdates
func (SettingsFormUpdates) StatusLine ¶
func (b SettingsFormUpdates) StatusLine() string
func (SettingsFormUpdates) Update ¶
func (m SettingsFormUpdates) Update(msg tea.Msg) (SettingsSection, tea.Cmd)
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) View ¶
func (m SettingsMenu) View() string
type SettingsMenuCloseMsg ¶
type SettingsMenuCloseMsg struct{}
type SettingsMenuSelectMsg ¶
type SettingsMenuSelectMsg struct {
// contains filtered or unexported fields
}
type SettingsSection ¶
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) RenderFullRow ¶
RenderFullRow renders a full-width starfield row.
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) 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 (g TerminalSizeGuard) Update(msg tea.WindowSizeMsg) TerminalSizeGuard
func (TerminalSizeGuard) View ¶
func (g TerminalSizeGuard) View() string
type TextField ¶
type TextField struct {
// contains filtered or unexported fields
}
func NewTextField ¶
func (*TextField) IsFocusable ¶
func (*TextField) SetCharLimit ¶
func (*TextField) SetDigitsOnly ¶
func (*TextField) SetEchoPassword ¶
func (f *TextField) SetEchoPassword()
func (*TextField) SetPlaceholder ¶
Source Files
¶
- actions_menu.go
- app.go
- chart.go
- chart_scale.go
- component.go
- confirmation.go
- dashboard.go
- dashboard_header.go
- dashboard_panel.go
- form.go
- help.go
- install.go
- install_activity.go
- install_app_list.go
- install_hostname_form.go
- install_image_form.go
- keys.go
- logo.go
- logs.go
- menu.go
- metric_card.go
- palette.go
- palette_detect.go
- popup_help.go
- progress.go
- remove.go
- settings.go
- settings_form_application.go
- settings_form_backups.go
- settings_form_base.go
- settings_form_email.go
- settings_form_environment.go
- settings_form_resources.go
- settings_form_updates.go
- settings_menu.go
- starfield.go
- styles.go
- terminal_size_guard.go