Documentation
¶
Index ¶
- Variables
- func LevelFilterLabel(idx int) string
- func StatusBarView(width int, frozen bool, shellFocused bool, shellOpen bool, sidebarFocused bool, ...) string
- func TitleBarView(width int, project string, visibleCount, totalCount int, notification string, ...) string
- type ActionMenuModel
- func (m *ActionMenuModel) Close()
- func (m ActionMenuModel) InlineView(width int, t theme.Theme) []string
- func (m *ActionMenuModel) OpenMenu(c *model.Container)
- func (m ActionMenuModel) Update(msg tea.KeyMsg, container *model.Container) (ActionMenuModel, tea.Cmd)
- func (m ActionMenuModel) View(width int) string
- type ContainerAction
- type CopiedMsg
- type ExecSession
- type ExecuteActionMsg
- type HelpModel
- type LogViewKeyMap
- type LogViewModel
- func (m *LogViewModel) ClampCursor()
- func (m *LogViewModel) ClickLine(lineIdx int)
- func (m *LogViewModel) CopyLine(lineIdx int) string
- func (m *LogViewModel) CtrlClickLine(lineIdx int)
- func (m *LogViewModel) Freeze()
- func (m *LogViewModel) ScrollDown(n int)
- func (m *LogViewModel) ScrollUp(n int)
- func (m *LogViewModel) ShiftClickLine(lineIdx int)
- func (m LogViewModel) Update(msg tea.KeyMsg, keys LogViewKeyMap) (LogViewModel, tea.Cmd)
- func (m LogViewModel) View() string
- func (m *LogViewModel) VisibleStartIndex() int
- type OpenActionMenuMsg
- type OpenShellMsg
- type PickerModel
- type RefilterMsg
- type SearchModel
- type ShellFocusLogs
- type ShellModel
- func (m *ShellModel) Close()
- func (m *ShellModel) HandleOutput(output string)
- func (m ShellModel) Handled(msg tea.KeyMsg) bool
- func (m ShellModel) IsOpen() bool
- func (m *ShellModel) Open(c *model.Container)
- func (m *ShellModel) ReadExecOutput() tea.Cmd
- func (m *ShellModel) SetExec(s ExecSession)
- func (m ShellModel) Update(msg tea.KeyMsg) (ShellModel, tea.Cmd)
- func (m ShellModel) View(width int) string
- type ShellOutputMsg
- type SidebarKeyMap
- type SidebarModel
- func (m *SidebarModel) HandleClick(contentY int)
- func (m *SidebarModel) HandleRightClick(contentY int) bool
- func (m SidebarModel) HiddenCount() int
- func (m SidebarModel) SelectedContainer() *model.Container
- func (m SidebarModel) Update(msg tea.KeyMsg, keys SidebarKeyMap) (SidebarModel, tea.Cmd)
- func (m SidebarModel) View() string
- func (m SidebarModel) VisibleContainers() []*model.Container
- func (m SidebarModel) VisibleCount() int
Constants ¶
This section is empty.
Variables ¶
var LevelFilters = []model.LogLevel{"", model.LevelError, model.LevelWarn, model.LevelInfo, model.LevelDebug}
LevelFilters defines the cycle order for log level filtering.
Functions ¶
func LevelFilterLabel ¶
LevelFilterLabel returns the display label for a filter index.
Types ¶
type ActionMenuModel ¶
type ActionMenuModel struct {
Open bool
Actions []ContainerAction
Cursor int
}
ActionMenuModel manages the container action menu overlay.
func (ActionMenuModel) InlineView ¶
func (m ActionMenuModel) InlineView(width int, t theme.Theme) []string
InlineView renders the action menu as lines to embed within the sidebar.
func (*ActionMenuModel) OpenMenu ¶
func (m *ActionMenuModel) OpenMenu(c *model.Container)
OpenMenu opens the action menu for a container.
func (ActionMenuModel) Update ¶
func (m ActionMenuModel) Update(msg tea.KeyMsg, container *model.Container) (ActionMenuModel, tea.Cmd)
func (ActionMenuModel) View ¶
func (m ActionMenuModel) View(width int) string
View renders the action menu as a bordered overlay box.
type ContainerAction ¶
ContainerAction represents an available action for a container.
func GetContainerActions ¶
func GetContainerActions(c *model.Container) []ContainerAction
GetContainerActions returns available actions for a container based on its status.
type ExecSession ¶
ExecSession is the interface the shell model uses to communicate with a Docker exec session. This keeps the ui package decoupled from the docker package.
type ExecuteActionMsg ¶
ExecuteActionMsg is sent when a user selects an action from the menu.
type HelpModel ¶
type HelpModel struct {
Visible bool
}
HelpModel manages the help overlay.
type LogViewKeyMap ¶
type LogViewKeyMap struct {
Up key.Binding
Down key.Binding
Top key.Binding
Bottom key.Binding
PageUp key.Binding
PageDown key.Binding
Select key.Binding
Copy key.Binding
ClearSel key.Binding
}
LogViewKeyMap holds log view key bindings.
type LogViewModel ¶
type LogViewModel struct {
Logs []*model.LogEntry
FilteredLogs []*model.LogEntry
Frozen bool
CursorLine int
SelectedLines map[int]bool
SelAnchor int
ShowTimestamps bool
WrapLines bool
Width int
Height int
NameWidth int // max container name width, set by app
}
LogViewModel manages the main log viewport.
func NewLogViewModel ¶
func NewLogViewModel() LogViewModel
func (*LogViewModel) ClampCursor ¶
func (m *LogViewModel) ClampCursor()
ClampCursor ensures cursor is within bounds after refilter.
func (*LogViewModel) ClickLine ¶
func (m *LogViewModel) ClickLine(lineIdx int)
ClickLine auto-freezes and moves cursor to the given line index.
func (*LogViewModel) CopyLine ¶
func (m *LogViewModel) CopyLine(lineIdx int) string
CopyLine returns the text of a single log line for clipboard copy.
func (*LogViewModel) CtrlClickLine ¶
func (m *LogViewModel) CtrlClickLine(lineIdx int)
CtrlClickLine toggles the clicked line in the selection without clearing existing selections. Auto-freezes if needed.
func (*LogViewModel) Freeze ¶
func (m *LogViewModel) Freeze()
Freeze toggles freeze state and adjusts cursor.
func (*LogViewModel) ScrollDown ¶
func (m *LogViewModel) ScrollDown(n int)
ScrollDown scrolls the view down by n lines.
func (*LogViewModel) ScrollUp ¶
func (m *LogViewModel) ScrollUp(n int)
ScrollUp scrolls the view up by n lines.
func (*LogViewModel) ShiftClickLine ¶
func (m *LogViewModel) ShiftClickLine(lineIdx int)
ShiftClickLine selects a range from the current cursor (or anchor) to the clicked line index, auto-freezing if necessary.
func (LogViewModel) Update ¶
func (m LogViewModel) Update(msg tea.KeyMsg, keys LogViewKeyMap) (LogViewModel, tea.Cmd)
func (LogViewModel) View ¶
func (m LogViewModel) View() string
func (*LogViewModel) VisibleStartIndex ¶
func (m *LogViewModel) VisibleStartIndex() int
VisibleStartIndex returns the index of the first visible log line in the current viewport, matching the logic in View().
type OpenActionMenuMsg ¶
type OpenActionMenuMsg struct{}
OpenActionMenuMsg requests opening the action menu.
type OpenShellMsg ¶
OpenShellMsg requests opening a shell for a container.
type PickerModel ¶
PickerModel is a simple list picker for selecting a project.
func NewPickerModel ¶
func NewPickerModel(title string, items []string) PickerModel
func (PickerModel) Init ¶
func (m PickerModel) Init() tea.Cmd
func (PickerModel) View ¶
func (m PickerModel) View() string
type RefilterMsg ¶
type RefilterMsg struct{}
RefilterMsg requests a log refilter after visibility change.
type SearchModel ¶
type SearchModel struct {
Query string
Regex *regexp.Regexp
IsRegex bool
Active bool
RegexError string
}
SearchModel manages search state.
func (SearchModel) Matches ¶
func (m SearchModel) Matches(msg string) bool
Matches returns whether a message matches the current search.
func (SearchModel) Update ¶
func (m SearchModel) Update(msg tea.KeyMsg) (SearchModel, tea.Cmd)
type ShellFocusLogs ¶
type ShellFocusLogs struct{}
ShellFocusLogs is sent when the user presses Esc in the shell.
type ShellModel ¶
type ShellModel struct {
Container *model.Container
Lines []string
Height int
Focused bool
// contains filtered or unexported fields
}
ShellModel manages the shell panel.
func NewShellModel ¶
func NewShellModel() ShellModel
func (*ShellModel) HandleOutput ¶
func (m *ShellModel) HandleOutput(output string)
HandleOutput appends output from the exec session to the shell lines.
func (ShellModel) Handled ¶
func (m ShellModel) Handled(msg tea.KeyMsg) bool
Handled returns true if the shell consumed the key. When false, the caller should process the key itself (e.g. tab to cycle focus, x to close shell).
func (ShellModel) IsOpen ¶
func (m ShellModel) IsOpen() bool
IsOpen returns whether the shell is open.
func (*ShellModel) Open ¶
func (m *ShellModel) Open(c *model.Container)
Open opens a shell for the given container.
func (*ShellModel) ReadExecOutput ¶
func (m *ShellModel) ReadExecOutput() tea.Cmd
ReadExecOutput returns a tea.Cmd that reads from the exec session and sends ShellOutputMsg messages. It should be started once when the exec session is attached.
func (*ShellModel) SetExec ¶
func (m *ShellModel) SetExec(s ExecSession)
SetExec attaches an exec session to the shell model.
func (ShellModel) Update ¶
func (m ShellModel) Update(msg tea.KeyMsg) (ShellModel, tea.Cmd)
func (ShellModel) View ¶
func (m ShellModel) View(width int) string
type ShellOutputMsg ¶
ShellOutputMsg carries output read from the exec session back into the Bubbletea update loop.
type SidebarKeyMap ¶
type SidebarKeyMap struct {
Up key.Binding
Down key.Binding
Toggle key.Binding
Action key.Binding
All key.Binding
Shell key.Binding
HideStopped key.Binding
}
SidebarKeyMap holds sidebar-specific key bindings.
type SidebarModel ¶
type SidebarModel struct {
Containers []*model.Container
Cursor int
Focused bool
Width int
Height int
ShellContainer *model.Container // currently open shell container
HideStopped bool // hide stopped/exited containers
ActionMenu *ActionMenuModel // action menu to render inline (set by app)
}
SidebarModel manages the container list sidebar.
func (*SidebarModel) HandleClick ¶
func (m *SidebarModel) HandleClick(contentY int)
HandleClick processes a left-click on the sidebar.
func (*SidebarModel) HandleRightClick ¶
func (m *SidebarModel) HandleRightClick(contentY int) bool
HandleRightClick processes a right-click, returning whether an action menu should open.
func (SidebarModel) HiddenCount ¶
func (m SidebarModel) HiddenCount() int
HiddenCount returns the number of hidden stopped containers.
func (SidebarModel) SelectedContainer ¶
func (m SidebarModel) SelectedContainer() *model.Container
SelectedContainer returns the container at the current cursor position.
func (SidebarModel) Update ¶
func (m SidebarModel) Update(msg tea.KeyMsg, keys SidebarKeyMap) (SidebarModel, tea.Cmd)
func (SidebarModel) View ¶
func (m SidebarModel) View() string
func (SidebarModel) VisibleContainers ¶
func (m SidebarModel) VisibleContainers() []*model.Container
VisibleContainers returns containers filtered by HideStopped.
func (SidebarModel) VisibleCount ¶
func (m SidebarModel) VisibleCount() int
VisibleCount returns how many containers have logs visible.