components

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToClipboard

func CopyToClipboard(text string) error

CopyToClipboard copies text to the system clipboard

Types

type ActionMenu

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

ActionMenu is a popup menu for actions

func NewActionMenu

func NewActionMenu() ActionMenu

func (*ActionMenu) Hide

func (m *ActionMenu) Hide()

func (ActionMenu) Init

func (m ActionMenu) Init() tea.Cmd

func (ActionMenu) IsVisible

func (m ActionMenu) IsVisible() bool

func (ActionMenu) Matches

func (m ActionMenu) Matches(msg tea.KeyMsg, binding key.Binding) bool

Verify ActionMenu satisfies common patterns

func (*ActionMenu) SetSize

func (m *ActionMenu) SetSize(width, height int)

func (*ActionMenu) Show

func (m *ActionMenu) Show(title string, items []MenuItem)

func (ActionMenu) Update

func (m ActionMenu) Update(msg tea.Msg) (ActionMenu, tea.Cmd)

func (ActionMenu) View

func (m ActionMenu) View() string

type ActionMenuResult

type ActionMenuResult struct {
	Item   MenuItem
	Copied bool
	Err    error
}

ActionMenuResult is returned when an action is selected

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

func NewBreadcrumb

func NewBreadcrumb() Breadcrumb
func (b *Breadcrumb) SetItems(items ...string)
func (b *Breadcrumb) SetWidth(width int)
func (b Breadcrumb) View() string

type ConfirmDialog

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

ConfirmDialog is a modal confirmation dialog

func NewConfirmDialog

func NewConfirmDialog() ConfirmDialog

func (*ConfirmDialog) Hide

func (c *ConfirmDialog) Hide()

func (ConfirmDialog) Init

func (c ConfirmDialog) Init() tea.Cmd

func (ConfirmDialog) IsVisible

func (c ConfirmDialog) IsVisible() bool

func (*ConfirmDialog) Show

func (c *ConfirmDialog) Show(title, message, action string, data interface{})

func (ConfirmDialog) Update

func (c ConfirmDialog) Update(msg tea.Msg) (ConfirmDialog, tea.Cmd)

func (ConfirmDialog) View

func (c ConfirmDialog) View() string

type ConfirmResult

type ConfirmResult struct {
	Confirmed bool
	Action    string
	Data      interface{}
}

ConfirmResult is returned when a confirmation is made

type EventsPanel

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

func NewEventsPanel

func NewEventsPanel() EventsPanel

func (EventsPanel) EventCount

func (e EventsPanel) EventCount() int

func (EventsPanel) Init

func (e EventsPanel) Init() tea.Cmd

func (EventsPanel) SelectedEvent

func (e EventsPanel) SelectedEvent() *k8s.EventInfo

func (*EventsPanel) SetEvents

func (e *EventsPanel) SetEvents(events []k8s.EventInfo)

func (*EventsPanel) SetSize

func (e *EventsPanel) SetSize(width, height int)

func (EventsPanel) Update

func (e EventsPanel) Update(msg tea.Msg) (EventsPanel, tea.Cmd)

func (EventsPanel) View

func (e EventsPanel) View() string

func (EventsPanel) WarningCount

func (e EventsPanel) WarningCount() int

type HelpEntry

type HelpEntry struct {
	Key  string
	Desc string
}

type HelpPanel

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

func NewHelpPanel

func NewHelpPanel() HelpPanel

func (*HelpPanel) Hide

func (h *HelpPanel) Hide()

func (HelpPanel) IsVisible

func (h HelpPanel) IsVisible() bool

func (*HelpPanel) SetSize

func (h *HelpPanel) SetSize(width, height int)

func (HelpPanel) ShortHelp

func (h HelpPanel) ShortHelp() string

func (*HelpPanel) Show

func (h *HelpPanel) Show()

func (*HelpPanel) Toggle

func (h *HelpPanel) Toggle()

func (HelpPanel) View

func (h HelpPanel) View() string

type LogsPanel

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

func NewLogsPanel

func NewLogsPanel() LogsPanel

func (LogsPanel) ErrorCount

func (l LogsPanel) ErrorCount() int

func (LogsPanel) Filter

func (l LogsPanel) Filter() string

func (LogsPanel) Init

func (l LogsPanel) Init() tea.Cmd

func (LogsPanel) IsFollowing

func (l LogsPanel) IsFollowing() bool

func (LogsPanel) IsSearching

func (l LogsPanel) IsSearching() bool

func (LogsPanel) LogCount

func (l LogsPanel) LogCount() int

func (LogsPanel) SelectedContainer

func (l LogsPanel) SelectedContainer() string

func (*LogsPanel) SetContainers

func (l *LogsPanel) SetContainers(containers []string)

func (*LogsPanel) SetFilter

func (l *LogsPanel) SetFilter(filter string)

func (*LogsPanel) SetLogs

func (l *LogsPanel) SetLogs(logs []k8s.LogLine)

func (*LogsPanel) SetSize

func (l *LogsPanel) SetSize(width, height int)

func (LogsPanel) ShowPrevious

func (l LogsPanel) ShowPrevious() bool

func (*LogsPanel) ToggleFollow

func (l *LogsPanel) ToggleFollow()

func (LogsPanel) Update

func (l LogsPanel) Update(msg tea.Msg) (LogsPanel, tea.Cmd)

func (LogsPanel) View

func (l LogsPanel) View() string

type ManifestPanel

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

func NewManifestPanel

func NewManifestPanel() ManifestPanel

func (ManifestPanel) Init

func (m ManifestPanel) Init() tea.Cmd

func (*ManifestPanel) SetHelpers

func (m *ManifestPanel) SetHelpers(helpers []k8s.DebugHelper)

func (*ManifestPanel) SetPod

func (m *ManifestPanel) SetPod(pod *k8s.PodInfo)

func (*ManifestPanel) SetRelated

func (m *ManifestPanel) SetRelated(related *k8s.RelatedResources)

func (*ManifestPanel) SetSize

func (m *ManifestPanel) SetSize(width, height int)

func (ManifestPanel) Update

func (m ManifestPanel) Update(msg tea.Msg) (ManifestPanel, tea.Cmd)

func (ManifestPanel) View

func (m ManifestPanel) View() string

type ManifestViewMode

type ManifestViewMode int
const (
	ManifestViewSummary ManifestViewMode = iota
	ManifestViewDetails
	ManifestViewResources
)
type MenuItem struct {
	Label    string
	Value    string // The command or value to copy/execute
	Shortcut string // Single key shortcut (1-9)
}

MenuItem represents a single menu item

func KubectlCommands

func KubectlCommands(namespace, podName, containerName string, containers []string) []MenuItem

KubectlCommands generates common kubectl commands for a pod

type MetricsPanel

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

func NewMetricsPanel

func NewMetricsPanel() MetricsPanel

func (MetricsPanel) Init

func (m MetricsPanel) Init() tea.Cmd

func (MetricsPanel) IsAvailable

func (m MetricsPanel) IsAvailable() bool

func (*MetricsPanel) SetMetrics

func (m *MetricsPanel) SetMetrics(metrics *k8s.PodMetrics)

func (*MetricsPanel) SetPod

func (m *MetricsPanel) SetPod(pod *k8s.PodInfo)

func (*MetricsPanel) SetSize

func (m *MetricsPanel) SetSize(width, height int)

func (MetricsPanel) Update

func (m MetricsPanel) Update(msg tea.Msg) (MetricsPanel, tea.Cmd)

func (MetricsPanel) View

func (m MetricsPanel) View() string
type Navigator struct {
	// contains filtered or unexported fields
}

func NewNavigator

func NewNavigator() Navigator
func (n *Navigator) ClearSearch()
func (n *Navigator) CloseSearch()
func (n Navigator) HasFilter() bool
func (n Navigator) Init() tea.Cmd
func (n Navigator) IsSearching() bool
func (n Navigator) Mode() NavigatorMode
func (n Navigator) Render(width int) string
func (n Navigator) ResourceType() k8s.ResourceType
func (n Navigator) SelectedNamespace() string
func (n Navigator) SelectedPod() *k8s.PodInfo
func (n Navigator) SelectedResourceType() k8s.ResourceType
func (n Navigator) SelectedWorkload() *k8s.WorkloadInfo
func (n *Navigator) SetMode(mode NavigatorMode)
func (n *Navigator) SetNamespaces(namespaces []string)
func (n *Navigator) SetPods(pods []k8s.PodInfo)
func (n *Navigator) SetResourceType(rt k8s.ResourceType)
func (n *Navigator) SetSize(width, height int)
func (n *Navigator) SetWorkloads(workloads []k8s.WorkloadInfo)
func (n Navigator) Update(msg tea.Msg) (Navigator, tea.Cmd)
func (n Navigator) View() string
type NavigatorMode int
const (
	ModeWorkloads NavigatorMode = iota
	ModePods
	ModeNamespace
	ModeResourceType
)

type PodActionItem

type PodActionItem struct {
	Label       string
	Description string
	Action      string // "delete", "exec", "port-forward", "copy"
	Command     string // kubectl command if applicable
}

PodActionItem represents an action that can be taken on a pod

func PodActions

func PodActions(namespace, podName string, containers []string) []PodActionItem

PodActions returns the available actions for a pod

type PodActionMenu

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

PodActionMenu is similar to ActionMenu but for pod actions

func NewPodActionMenu

func NewPodActionMenu() PodActionMenu

func (*PodActionMenu) Hide

func (m *PodActionMenu) Hide()

func (PodActionMenu) Init

func (m PodActionMenu) Init() tea.Cmd

func (PodActionMenu) IsVisible

func (m PodActionMenu) IsVisible() bool

func (*PodActionMenu) Show

func (m *PodActionMenu) Show(title string, items []PodActionItem)

func (PodActionMenu) Update

func (m PodActionMenu) Update(msg tea.Msg) (PodActionMenu, tea.Cmd)

func (PodActionMenu) View

func (m PodActionMenu) View() string

type PodActionMenuResult

type PodActionMenuResult struct {
	Item PodActionItem
}

PodActionMenuResult is returned when a pod action is selected

type ResultViewer

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

ResultViewer displays command output in a scrollable viewport

func NewResultViewer

func NewResultViewer() ResultViewer

func (*ResultViewer) Hide

func (r *ResultViewer) Hide()

func (ResultViewer) Init

func (r ResultViewer) Init() tea.Cmd

func (ResultViewer) IsVisible

func (r ResultViewer) IsVisible() bool

func (*ResultViewer) SetSize

func (r *ResultViewer) SetSize(width, height int)

func (*ResultViewer) Show

func (r *ResultViewer) Show(title, content string, width, height int)

func (ResultViewer) Update

func (r ResultViewer) Update(msg tea.Msg) (ResultViewer, tea.Cmd)

func (ResultViewer) View

func (r ResultViewer) View() string

type StatusBar

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

func NewStatusBar

func NewStatusBar() StatusBar

func (*StatusBar) SetContext

func (s *StatusBar) SetContext(ctx string)

func (*StatusBar) SetNamespace

func (s *StatusBar) SetNamespace(ns string)

func (*StatusBar) SetResource

func (s *StatusBar) SetResource(res string)

func (*StatusBar) SetStatus

func (s *StatusBar) SetStatus(status string)

func (*StatusBar) SetWidth

func (s *StatusBar) SetWidth(width int)

func (StatusBar) View

func (s StatusBar) View() string

type TimeFilter

type TimeFilter int
const (
	TimeFilterAll TimeFilter = iota
	TimeFilter5Min
	TimeFilter15Min
	TimeFilter1Hour
	TimeFilter6Hours
)

type WorkloadActionItem

type WorkloadActionItem struct {
	Label       string
	Description string
	Action      string // "scale", "restart", "copy"
	Replicas    int32  // For scale actions
	Command     string // kubectl command
}

WorkloadActionItem represents an action for workloads

func ScaleActions

func ScaleActions(namespace, name, resourceType string, currentReplicas int32) []WorkloadActionItem

ScaleActions returns scale options for a workload

type WorkloadActionMenu

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

WorkloadActionMenu for workload actions

func NewWorkloadActionMenu

func NewWorkloadActionMenu() WorkloadActionMenu

func (*WorkloadActionMenu) Hide

func (m *WorkloadActionMenu) Hide()

func (WorkloadActionMenu) Init

func (m WorkloadActionMenu) Init() tea.Cmd

func (WorkloadActionMenu) IsVisible

func (m WorkloadActionMenu) IsVisible() bool

func (*WorkloadActionMenu) Show

func (m *WorkloadActionMenu) Show(title string, items []WorkloadActionItem)

func (WorkloadActionMenu) Update

func (WorkloadActionMenu) View

func (m WorkloadActionMenu) View() string

type WorkloadActionMenuResult

type WorkloadActionMenuResult struct {
	Item WorkloadActionItem
}

WorkloadActionMenuResult is returned when a workload action is selected

Jump to

Keyboard shortcuts

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