Documentation
¶
Index ¶
- func BuildRunsListFiltersForm(filters *RunsListFilters, workflows []WorkflowOption) (*huh.Form, *[]rest.V1TaskStatus)
- func FormatEventType(eventType rest.V1TaskEventType) string
- func FormatV1TaskStatusForTable(status rest.V1TaskStatus) string
- func GetTimeRangeFromWindow(window string) time.Time
- func HandleDebugKeyboard(logger *DebugLogger, key string) (bool, tea.Cmd)
- func NewNavigateBackMsg() tea.Cmd
- func NewNavigateToRunMsg(workflowRunID string) tea.Cmd
- func NewNavigateToRunWithDetectionMsg(runID string) tea.Cmd
- func NewNavigateToWorkerMsg(workerID string) tea.Cmd
- func NewNavigateToWorkflowMsg(workflowID string) tea.Cmd
- func RenderDebugView(logger *DebugLogger, width, height int, extraInfo string) string
- func RenderError(message string, width int) string
- func RenderEventSeverityDot(severity EventSeverity) string
- func RenderFooter(controls []string, width int) string
- func RenderHeader(title string, profileName string, width int) string
- func RenderHeaderWithLogo(title string, width int) string
- func RenderHeaderWithViewIndicator(viewName string, profileName string, width int) string
- func RenderInstructions(instructions string, width int) string
- func RenderLogo() string
- func RenderV1TaskStatus(status rest.V1TaskStatus) string
- func SortEventsByTimestamp(events []rest.V1TaskEvent) []rest.V1TaskEvent
- type BaseModel
- type ContentViewer
- func (v *ContentViewer) Activate()
- func (v *ContentViewer) Deactivate()
- func (v *ContentViewer) HandleMouse(msg tea.MouseMsg)
- func (v *ContentViewer) IsActive() bool
- func (v *ContentViewer) RenderPreview() string
- func (v *ContentViewer) ScrollDown()
- func (v *ContentViewer) ScrollPageDown()
- func (v *ContentViewer) ScrollPageUp()
- func (v *ContentViewer) ScrollToBottom()
- func (v *ContentViewer) ScrollToTop()
- func (v *ContentViewer) ScrollUp()
- func (v *ContentViewer) SetContent(content string)
- func (v *ContentViewer) SetSize(width, height int)
- func (v *ContentViewer) Update(msg tea.Msg) tea.Cmd
- func (v *ContentViewer) View() string
- type DAGTab
- type DebugLog
- type DebugLogger
- func (d *DebugLogger) CancelFilePrompt()
- func (d *DebugLogger) Capacity() int
- func (d *DebugLogger) CheckAndWriteFile() tea.Cmd
- func (d *DebugLogger) Clear()
- func (d *DebugLogger) ClearStatusMessage()
- func (d *DebugLogger) ConfirmOverwrite() tea.Cmd
- func (d *DebugLogger) GetFileInput() string
- func (d *DebugLogger) GetLogs() []DebugLog
- func (d *DebugLogger) GetLogsAsString() string
- func (d *DebugLogger) GetStatusMessage() string
- func (d *DebugLogger) HandleFileInput(key string)
- func (d *DebugLogger) IsConfirmingOverwrite() bool
- func (d *DebugLogger) IsPromptingFile() bool
- func (d *DebugLogger) Log(format string, args ...interface{})
- func (d *DebugLogger) Size() int
- func (d *DebugLogger) StartFilePrompt()
- func (d *DebugLogger) WriteToFile() tea.Cmd
- type EventSeverity
- type HelpView
- type NavigateBackMsg
- type NavigateToRunMsg
- type NavigateToRunWithDetectionMsg
- type NavigateToWorkerMsg
- type NavigateToWorkflowMsg
- type RunDetailsView
- type RunTypeDetectedMsg
- type RunsListFilters
- type RunsListView
- type SingleTaskTab
- type SingleTaskView
- type StatusStyle
- type TableWithStyleFunc
- func (t *TableWithStyleFunc) Columns() []table.Column
- func (t *TableWithStyleFunc) Cursor() int
- func (t *TableWithStyleFunc) Height() int
- func (t *TableWithStyleFunc) Rows() []table.Row
- func (t *TableWithStyleFunc) SetHeight(height int)
- func (t *TableWithStyleFunc) SetRows(rows []table.Row)
- func (t *TableWithStyleFunc) SetStyleFunc(fn func(row, col int) lipgloss.Style)
- func (t *TableWithStyleFunc) SetStyles(s table.Styles)
- func (t *TableWithStyleFunc) Update(msg interface{}) (table.Model, tea.Cmd)
- func (t *TableWithStyleFunc) View() string
- type View
- type ViewContext
- type WorkerDetailsView
- type WorkersView
- type WorkflowDetailsView
- type WorkflowOption
- type WorkflowsView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRunsListFiltersForm ¶
func BuildRunsListFiltersForm(filters *RunsListFilters, workflows []WorkflowOption) (*huh.Form, *[]rest.V1TaskStatus)
BuildRunsListFiltersForm builds a huh.Form for editing filters This form is meant to be embedded directly in the main tea.Program Returns the form and a pointer to the status slice that will be modified
func FormatEventType ¶
func FormatEventType(eventType rest.V1TaskEventType) string
FormatEventType maps a V1TaskEventType enum to a human-readable string Mapping taken from frontend: frontend/app/src/pages/main/v1/workflow-runs-v1/$run/v2components/events-columns.tsx
func FormatV1TaskStatusForTable ¶
func FormatV1TaskStatusForTable(status rest.V1TaskStatus) string
FormatV1TaskStatusForTable returns plain text with a status indicator icon Use this for table cells since bubbles table doesn't support per-cell colors
func GetTimeRangeFromWindow ¶
GetTimeRangeFromWindow converts time window string to time.Time
func HandleDebugKeyboard ¶
func HandleDebugKeyboard(logger *DebugLogger, key string) (bool, tea.Cmd)
HandleDebugKeyboard handles keyboard input for debug views with file writing Returns true if the key was handled, along with any command to execute
func NewNavigateBackMsg ¶
NewNavigateBackMsg creates a navigation message to go back
func NewNavigateToRunMsg ¶
NewNavigateToRunMsg creates a navigation message to a workflow run (deprecated)
func NewNavigateToRunWithDetectionMsg ¶
NewNavigateToRunWithDetectionMsg creates a navigation message with run type detection
func NewNavigateToWorkerMsg ¶
NewNavigateToWorkerMsg creates a navigation message to a worker details view
func NewNavigateToWorkflowMsg ¶
NewNavigateToWorkflowMsg creates a navigation message to a workflow details view
func RenderDebugView ¶
func RenderDebugView(logger *DebugLogger, width, height int, extraInfo string) string
RenderDebugView renders a debug log overlay with file writing support
func RenderError ¶
RenderError renders an error message in error style with text wrapping
func RenderEventSeverityDot ¶
func RenderEventSeverityDot(severity EventSeverity) string
RenderEventSeverityDot returns a colored dot indicator for the severity level
func RenderFooter ¶
RenderFooter renders a consistent footer with controls/help text
func RenderHeader ¶
RenderHeader renders a consistent header with logo for all views
func RenderHeaderWithLogo ¶
RenderHeaderWithLogo creates a header with the logo on the right side Returns the rendered header with proper spacing and borders
func RenderHeaderWithViewIndicator ¶
RenderHeaderWithViewIndicator renders a header with just the view name in magenta viewName is highlighted in magenta to show which primary view is active
func RenderInstructions ¶
RenderInstructions renders instruction text in a consistent style
func RenderV1TaskStatus ¶
func RenderV1TaskStatus(status rest.V1TaskStatus) string
RenderV1TaskStatus renders a V1TaskStatus as a styled badge Matches the frontend Badge component styling
func SortEventsByTimestamp ¶
func SortEventsByTimestamp(events []rest.V1TaskEvent) []rest.V1TaskEvent
SortEventsByTimestamp sorts events by timestamp in descending order (newest first)
Types ¶
type BaseModel ¶
type BaseModel struct {
Ctx ViewContext
Width int
Height int
Err error
}
BaseModel contains common fields for all views
func (*BaseModel) ClearError ¶
func (m *BaseModel) ClearError()
ClearError clears any error on the base model
func (*BaseModel) HandleError ¶
HandleError sets an error on the base model
type ContentViewer ¶
type ContentViewer struct {
// contains filtered or unexported fields
}
ContentViewer is a component for viewing long content with scrolling and file writing
func NewContentViewer ¶
func NewContentViewer(content string, width, height int) *ContentViewer
NewContentViewer creates a new content viewer
func (*ContentViewer) HandleMouse ¶
func (v *ContentViewer) HandleMouse(msg tea.MouseMsg)
HandleMouse handles mouse events even when not active (for preview mode scrolling)
func (*ContentViewer) IsActive ¶
func (v *ContentViewer) IsActive() bool
IsActive returns whether the viewer is in dive mode
func (*ContentViewer) RenderPreview ¶
func (v *ContentViewer) RenderPreview() string
RenderPreview renders a preview with dive hint (public method for external use)
func (*ContentViewer) ScrollDown ¶
func (v *ContentViewer) ScrollDown()
ScrollDown scrolls down by one line
func (*ContentViewer) ScrollPageDown ¶
func (v *ContentViewer) ScrollPageDown()
ScrollPageDown scrolls down by one page
func (*ContentViewer) ScrollPageUp ¶
func (v *ContentViewer) ScrollPageUp()
ScrollPageUp scrolls up by one page
func (*ContentViewer) ScrollToBottom ¶
func (v *ContentViewer) ScrollToBottom()
ScrollToBottom scrolls to the bottom
func (*ContentViewer) ScrollToTop ¶
func (v *ContentViewer) ScrollToTop()
ScrollToTop scrolls to the top
func (*ContentViewer) SetContent ¶
func (v *ContentViewer) SetContent(content string)
SetContent updates the content
func (*ContentViewer) SetSize ¶
func (v *ContentViewer) SetSize(width, height int)
SetSize updates the viewer dimensions
type DebugLogger ¶
type DebugLogger struct {
// contains filtered or unexported fields
}
DebugLogger is a fixed-size ring buffer for debug logs with file writing support
func NewDebugLogger ¶
func NewDebugLogger(capacity int) *DebugLogger
NewDebugLogger creates a new debug logger with the specified capacity
func (*DebugLogger) CancelFilePrompt ¶
func (d *DebugLogger) CancelFilePrompt()
CancelFilePrompt cancels the file writing prompt
func (*DebugLogger) Capacity ¶
func (d *DebugLogger) Capacity() int
Capacity returns the maximum capacity
func (*DebugLogger) CheckAndWriteFile ¶
func (d *DebugLogger) CheckAndWriteFile() tea.Cmd
CheckAndWriteFile checks if file exists and writes or prompts for confirmation
func (*DebugLogger) ClearStatusMessage ¶
func (d *DebugLogger) ClearStatusMessage()
ClearStatusMessage clears the status message
func (*DebugLogger) ConfirmOverwrite ¶
func (d *DebugLogger) ConfirmOverwrite() tea.Cmd
ConfirmOverwrite confirms overwriting an existing file
func (*DebugLogger) GetFileInput ¶
func (d *DebugLogger) GetFileInput() string
GetFileInput returns the current file input
func (*DebugLogger) GetLogs ¶
func (d *DebugLogger) GetLogs() []DebugLog
GetLogs returns all logs in chronological order
func (*DebugLogger) GetLogsAsString ¶
func (d *DebugLogger) GetLogsAsString() string
GetLogsAsString returns all logs formatted as a string
func (*DebugLogger) GetStatusMessage ¶
func (d *DebugLogger) GetStatusMessage() string
GetStatusMessage returns the current status message
func (*DebugLogger) HandleFileInput ¶
func (d *DebugLogger) HandleFileInput(key string)
HandleFileInput handles keyboard input for filename
func (*DebugLogger) IsConfirmingOverwrite ¶
func (d *DebugLogger) IsConfirmingOverwrite() bool
IsConfirmingOverwrite returns whether confirming file overwrite
func (*DebugLogger) IsPromptingFile ¶
func (d *DebugLogger) IsPromptingFile() bool
IsPromptingFile returns whether the logger is prompting for a filename
func (*DebugLogger) Log ¶
func (d *DebugLogger) Log(format string, args ...interface{})
Log adds a new log entry to the ring buffer
func (*DebugLogger) StartFilePrompt ¶
func (d *DebugLogger) StartFilePrompt()
StartFilePrompt initiates the file writing prompt
func (*DebugLogger) WriteToFile ¶
func (d *DebugLogger) WriteToFile() tea.Cmd
WriteToFile writes the logs to the specified file
type EventSeverity ¶
type EventSeverity int
EventSeverity represents the severity level of a task event
const ( EventSeverityInfo EventSeverity = iota EventSeverityWarning EventSeverityCritical )
func GetEventSeverity ¶
func GetEventSeverity(eventType rest.V1TaskEventType) EventSeverity
GetEventSeverity returns the severity level for a given event type
type HelpView ¶
type HelpView struct {
BaseModel
// contains filtered or unexported fields
}
HelpView displays a fullscreen help modal with ASCII art logo and command reference
type NavigateBackMsg ¶
type NavigateBackMsg struct{}
NavigateBackMsg is sent when navigating back to the tasks view
type NavigateToRunMsg ¶
type NavigateToRunMsg struct {
}
NavigateToRunMsg is sent when navigating to a workflow run details view (deprecated, use NavigateToRunWithDetectionMsg)
type NavigateToRunWithDetectionMsg ¶
type NavigateToRunWithDetectionMsg struct {
}
NavigateToRunWithDetectionMsg requests detection of run type (task vs dag)
type NavigateToWorkerMsg ¶
type NavigateToWorkerMsg struct {
}
NavigateToWorkerMsg is sent when navigating to a worker details view
type NavigateToWorkflowMsg ¶
type NavigateToWorkflowMsg struct {
}
NavigateToWorkflowMsg is sent when navigating to a workflow details view
type RunDetailsView ¶
type RunDetailsView struct {
BaseModel
// contains filtered or unexported fields
}
RunDetailsView displays details for a DAG workflow run (multiple tasks)
func NewRunDetailsView ¶
func NewRunDetailsView(ctx ViewContext, workflowRunID string) *RunDetailsView
NewRunDetailsView creates a new DAG workflow run details view
func (*RunDetailsView) SetSize ¶
func (v *RunDetailsView) SetSize(width, height int)
SetSize updates the view dimensions and rebuilds the DAG
func (*RunDetailsView) View ¶
func (v *RunDetailsView) View() string
View renders the view to a string
type RunTypeDetectedMsg ¶
type RunTypeDetectedMsg struct {
Type string // "task" or "dag"
TaskData *rest.V1TaskSummary
DAGData *rest.V1WorkflowRunDetails
Error error
}
RunTypeDetectedMsg contains the detected run type and data
type RunsListFilters ¶
type RunsListFilters struct {
WorkflowIDs []string // Multiple workflow IDs
Statuses map[rest.V1TaskStatus]bool
TimeWindow string // "1h", "6h", "1d", "7d", "custom"
Since time.Time
Until *time.Time
}
RunsListFilters holds the current filter state
func NewDefaultRunsListFilters ¶
func NewDefaultRunsListFilters() *RunsListFilters
NewDefaultRunsListFilters creates default filters matching frontend defaults
func RunFiltersFormProgram ¶
func RunFiltersFormProgram(currentFilters *RunsListFilters, workflows []WorkflowOption) (*RunsListFilters, error)
RunFiltersFormProgram runs the filters form in a separate tea.Program This ensures it takes full control of the terminal without interference
func ShowFiltersForm ¶
func ShowFiltersForm(currentFilters *RunsListFilters, workflows []WorkflowOption) (*RunsListFilters, error)
ShowFiltersForm displays a form to edit filters (deprecated, use RunFiltersFormProgram)
func (*RunsListFilters) GetActiveStatuses ¶
func (f *RunsListFilters) GetActiveStatuses() []rest.V1TaskStatus
GetActiveStatuses returns a slice of enabled statuses
type RunsListView ¶
type RunsListView struct {
BaseModel
// contains filtered or unexported fields
}
RunsListView displays a list of runs in a table
func NewRunsListView ¶
func NewRunsListView(ctx ViewContext) *RunsListView
NewRunsListView creates a new runs list view
func (*RunsListView) SetSize ¶
func (v *RunsListView) SetSize(width, height int)
SetSize updates the view dimensions
type SingleTaskTab ¶
type SingleTaskTab int
SingleTaskTab represents different tabs in the single task view
const ( SingleTaskTabOutput SingleTaskTab = iota SingleTaskTabInput SingleTaskTabEvents SingleTaskTabLogs )
type SingleTaskView ¶
type SingleTaskView struct {
BaseModel
// contains filtered or unexported fields
}
SingleTaskView displays details for a single task run
func NewSingleTaskView ¶
func NewSingleTaskView(ctx ViewContext, taskID string) *SingleTaskView
NewSingleTaskView creates a new single task details view
func (*SingleTaskView) View ¶
func (v *SingleTaskView) View() string
View renders the view to a string
type StatusStyle ¶
type StatusStyle struct {
Text string
Foreground lipgloss.AdaptiveColor
Background lipgloss.AdaptiveColor
}
StatusStyle defines the styling for a status badge
func GetV1TaskStatusStyle ¶
func GetV1TaskStatusStyle(status rest.V1TaskStatus) StatusStyle
GetV1TaskStatusStyle returns the appropriate style for a V1TaskStatus Matches frontend createV1RunStatusVariant from run-statuses.tsx
type TableWithStyleFunc ¶
TableWithStyleFunc wraps bubbles table.Model and adds per-cell styling support
func NewTableWithStyleFunc ¶
func NewTableWithStyleFunc(opts ...table.Option) *TableWithStyleFunc
NewTableWithStyleFunc creates a new table with StyleFunc support
func (*TableWithStyleFunc) Columns ¶
func (t *TableWithStyleFunc) Columns() []table.Column
Columns returns the table columns
func (*TableWithStyleFunc) Cursor ¶
func (t *TableWithStyleFunc) Cursor() int
Cursor returns the current cursor position
func (*TableWithStyleFunc) Height ¶
func (t *TableWithStyleFunc) Height() int
Height returns the table height
func (*TableWithStyleFunc) Rows ¶
func (t *TableWithStyleFunc) Rows() []table.Row
Rows returns the table rows
func (*TableWithStyleFunc) SetHeight ¶
func (t *TableWithStyleFunc) SetHeight(height int)
SetHeight sets the table height
func (*TableWithStyleFunc) SetRows ¶
func (t *TableWithStyleFunc) SetRows(rows []table.Row)
SetRows sets the table rows
func (*TableWithStyleFunc) SetStyleFunc ¶
func (t *TableWithStyleFunc) SetStyleFunc(fn func(row, col int) lipgloss.Style)
SetStyleFunc sets the function that determines styling for each cell
func (*TableWithStyleFunc) SetStyles ¶
func (t *TableWithStyleFunc) SetStyles(s table.Styles)
SetStyles sets the table styles
func (*TableWithStyleFunc) Update ¶
func (t *TableWithStyleFunc) Update(msg interface{}) (table.Model, tea.Cmd)
Update delegates to the underlying table model and handles all events including mouse
func (*TableWithStyleFunc) View ¶
func (t *TableWithStyleFunc) View() string
View renders the table with per-cell styling
type View ¶
type View interface {
// Init initializes the view and returns any initial commands
Init() tea.Cmd
// Update handles messages and updates the view state
Update(msg tea.Msg) (View, tea.Cmd)
// View renders the view to a string
View() string
// SetSize updates the view dimensions
SetSize(width, height int)
}
View represents a TUI view component
type ViewContext ¶
type ViewContext struct {
// Profile name for display
ProfileName string
// Hatchet client for API calls
Client client.Client
// Terminal dimensions
Width int
Height int
}
ViewContext contains the shared context passed to all views
type WorkerDetailsView ¶
type WorkerDetailsView struct {
BaseModel
// contains filtered or unexported fields
}
WorkerDetailsView displays details about a specific worker
func NewWorkerDetailsView ¶
func NewWorkerDetailsView(ctx ViewContext, workerID string) *WorkerDetailsView
NewWorkerDetailsView creates a new worker details view
func (*WorkerDetailsView) Init ¶
func (v *WorkerDetailsView) Init() tea.Cmd
Init initializes the view
func (*WorkerDetailsView) SetSize ¶
func (v *WorkerDetailsView) SetSize(width, height int)
SetSize updates the view dimensions
func (*WorkerDetailsView) View ¶
func (v *WorkerDetailsView) View() string
View renders the view to a string
type WorkersView ¶
type WorkersView struct {
BaseModel
// contains filtered or unexported fields
}
WorkersView displays a list of workers in a table
func NewWorkersView ¶
func NewWorkersView(ctx ViewContext) *WorkersView
NewWorkersView creates a new workers list view
func (*WorkersView) SetSize ¶
func (v *WorkersView) SetSize(width, height int)
SetSize updates the view dimensions
type WorkflowDetailsView ¶
type WorkflowDetailsView struct {
BaseModel
// contains filtered or unexported fields
}
WorkflowDetailsView displays details about a specific workflow and its recent runs
func NewWorkflowDetailsView ¶
func NewWorkflowDetailsView(ctx ViewContext, workflowID string) *WorkflowDetailsView
NewWorkflowDetailsView creates a new workflow details view
func (*WorkflowDetailsView) Init ¶
func (v *WorkflowDetailsView) Init() tea.Cmd
Init initializes the view
func (*WorkflowDetailsView) SetSize ¶
func (v *WorkflowDetailsView) SetSize(width, height int)
SetSize updates the view dimensions
func (*WorkflowDetailsView) View ¶
func (v *WorkflowDetailsView) View() string
View renders the view to a string
type WorkflowOption ¶
WorkflowOption represents a workflow for the selector
func FetchWorkflows ¶
func FetchWorkflows(ctx context.Context, client rest.ClientWithResponsesInterface, tenantID string) ([]WorkflowOption, error)
FetchWorkflows fetches available workflows for filtering
type WorkflowsView ¶
type WorkflowsView struct {
BaseModel
// contains filtered or unexported fields
}
WorkflowsView displays a list of workflows in a table
func NewWorkflowsView ¶
func NewWorkflowsView(ctx ViewContext) *WorkflowsView
NewWorkflowsView creates a new workflows list view
func (*WorkflowsView) SetSize ¶
func (v *WorkflowsView) SetSize(width, height int)
SetSize updates the view dimensions
func (*WorkflowsView) View ¶
func (v *WorkflowsView) View() string
View renders the view to a string