Documentation
¶
Overview ¶
Package tui implements the interactive terminal user interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ColorGreen = lipgloss.Color("#00FF00") ColorYellow = lipgloss.Color("#FFFF00") ColorRed = lipgloss.Color("#FF0000") ColorGray = lipgloss.Color("#808080") ColorBlue = lipgloss.Color("#0080FF") ColorWhite = lipgloss.Color("#FFFFFF") ColorBlack = lipgloss.Color("#000000") ColorDim = lipgloss.Color("#666666") )
Colors
View Source
var ( // Title style for the header TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorWhite). Background(ColorBlue). Padding(0, 1) // Subtle title (no background) SubtitleStyle = lipgloss.NewStyle(). Foreground(ColorDim) // Border style BorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(ColorGray) // Status bar at the bottom StatusBarStyle = lipgloss.NewStyle(). Background(lipgloss.Color("#333333")). Foreground(ColorWhite). Padding(0, 1) // Help text style HelpStyle = lipgloss.NewStyle(). Foreground(ColorDim) // Selected row SelectedStyle = lipgloss.NewStyle(). Background(ColorBlue). Foreground(ColorWhite) // Normal row NormalStyle = lipgloss.NewStyle() // Status colors StatusRunning = lipgloss.NewStyle().Foreground(ColorGreen) StatusStarting = lipgloss.NewStyle().Foreground(ColorYellow) StatusStopped = lipgloss.NewStyle().Foreground(ColorGray) StatusCrashed = lipgloss.NewStyle().Foreground(ColorRed) // Log styles LogTimestamp = lipgloss.NewStyle().Foreground(ColorDim) LogStdout = lipgloss.NewStyle().Foreground(ColorWhite) LogStderr = lipgloss.NewStyle().Foreground(ColorRed) // Error message ErrorStyle = lipgloss.NewStyle(). Foreground(ColorRed). Bold(true) )
Styles
View Source
var Keys = KeyMap{ Quit: key.NewBinding( key.WithKeys("q", "ctrl+c"), key.WithHelp("q", "quit"), ), Help: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "help"), ), Up: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("↑/k", "up"), ), Down: key.NewBinding( key.WithKeys("down", "j"), key.WithHelp("↓/j", "down"), ), Start: key.NewBinding( key.WithKeys("s"), key.WithHelp("s", "start"), ), Stop: key.NewBinding( key.WithKeys("x"), key.WithHelp("x", "stop"), ), Restart: key.NewBinding( key.WithKeys("r"), key.WithHelp("r", "restart"), ), StartAll: key.NewBinding( key.WithKeys("S"), key.WithHelp("S", "start all"), ), StopAll: key.NewBinding( key.WithKeys("X"), key.WithHelp("X", "stop all"), ), Logs: key.NewBinding( key.WithKeys("l", "enter"), key.WithHelp("l", "logs"), ), Back: key.NewBinding( key.WithKeys("esc", "backspace"), key.WithHelp("esc", "back"), ), Kill: key.NewBinding( key.WithKeys("K"), key.WithHelp("K", "force kill"), ), }
Keys contains the default key bindings.
Functions ¶
func GetStatusStyle ¶
GetStatusStyle returns the appropriate style for a service state.
Types ¶
type KeyMap ¶
type KeyMap struct {
Quit key.Binding
Help key.Binding
Up key.Binding
Down key.Binding
Start key.Binding
Stop key.Binding
Restart key.Binding
StartAll key.Binding
StopAll key.Binding
Logs key.Binding
Back key.Binding
Kill key.Binding
}
KeyMap defines all keyboard shortcuts.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main TUI model.
type ServiceEventMsg ¶
ServiceEventMsg wraps a process event for the TUI.
Click to show internal directories.
Click to hide internal directories.