tui

package
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(version string) error

Run starts the bubbletea program with the shared podman cache warmed up. Called from cli.NewTuiCmd so the wiring lives next to the rest of the command registry.

Types

type ActionResult

type ActionResult struct {
	Summary string
	Err     error
	Detail  string
}

ActionResult is emitted when an async action (start/stop/restart) finishes. The status bar renders Err/Detail so the user sees failures without dropping out of the TUI.

type LogKind

type LogKind int

LogKind picks between `podman logs` (containers), `journalctl --user` (worker systemd units), and `tail -F` (framework app log files). Workers don't run as containers so their output lives in the user journal; sites and services do, and their history is richer when pulled from podman; framework app logs (laravel.log, etc.) live on disk because the framework writes them directly.

type LogTarget

type LogTarget struct {
	Kind  LogKind
	ID    string
	Label string
}

LogTarget fully describes one tail-able source: what to tail, how to tail it, and how to label it in the pane header.

type Model

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

Model is the bubbletea root. Panes are all projections of snap plus small per-pane cursor/scroll state, so every refresh cycle rebuilds from a single source of truth without stale data.

func NewModel

func NewModel(version string) *Model

NewModel builds an initial model. The caller is expected to call podman.Cache.Start before running; NewModel itself is pure.

func (*Model) Init

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

Init implements tea.Model. Kicks off the first snapshot load, the refresh ticker, the eventbus subscription, and a one-shot update check.

func (*Model) Update

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

Update implements tea.Model.

func (*Model) View

func (m *Model) View() string

View implements tea.Model.

type ServiceRow

type ServiceRow struct {
	Name      string
	State     ServiceState
	Custom    bool
	Pinned    bool
	SiteCount int
	Dashboard string
	DependsOn []string

	WorkerSite string
	WorkerKind string
	WorkerPath string
}

ServiceRow is a flat row for the services pane. Sourced from podman unit status and service config so the TUI doesn't need to reach into ui/server.go. For site-owned workers (queue, schedule, horizon, reverb, custom framework workers) WorkerSite / WorkerKind are set so actions can run the right per-site command instead of `lerd service start/stop` which would fail.

type ServiceState

type ServiceState int

ServiceState is a tri-state the TUI uses to pick a glyph and colour.

type Snapshot

type Snapshot struct {
	Sites    []siteinfo.EnrichedSite
	Services []ServiceRow
	Status   StatusRow
}

Snapshot is the full view-model the TUI renders from. Produced by loadSnapshot from the same sources lerd-ui uses, so every pane reflects the same point-in-time state.

type StatusRow

type StatusRow struct {
	DNSOk          bool
	TLD            string
	NginxRunning   bool
	WatcherRunning bool
	PHPRunning     []string
	Version        string
}

StatusRow drives the top header bar.

Jump to

Keyboard shortcuts

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