views

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderHelpBar

func RenderHelpBar(width int, hasSelection, isLoading, isIncidentsTab bool, currentPage, totalPages, totalCount int) string

RenderHelpBar renders the bottom help bar hasSelection indicates whether an incident or alert is currently selected isLoading indicates whether data is currently being loaded isIncidentsTab indicates whether we're on the incidents tab (for sorting hints) currentPage, totalPages, totalCount are for pagination display

Types

type APIKeyValidatedMsg

type APIKeyValidatedMsg struct {
	Valid bool
	Error string
}

type AboutModel

type AboutModel struct {
	Visible bool
	// contains filtered or unexported fields
}

func NewAboutModel

func NewAboutModel(version string) AboutModel

func (*AboutModel) Hide

func (m *AboutModel) Hide()

func (*AboutModel) Show

func (m *AboutModel) Show()

func (*AboutModel) Toggle

func (m *AboutModel) Toggle()

func (AboutModel) View

func (m AboutModel) View() string

type AlertsModel

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

func NewAlertsModel

func NewAlertsModel() AlertsModel

func (*AlertsModel) ClearDetailLoading

func (m *AlertsModel) ClearDetailLoading()

func (AlertsModel) CurrentPage

func (m AlertsModel) CurrentPage() int

Pagination methods

func (AlertsModel) GetDetailPlainText added in v0.2.0

func (m AlertsModel) GetDetailPlainText() string

GetDetailPlainText returns the detail panel content as plain text for clipboard

func (AlertsModel) HasNextPage

func (m AlertsModel) HasNextPage() bool

func (AlertsModel) HasPrevPage

func (m AlertsModel) HasPrevPage() bool

func (AlertsModel) Init

func (m AlertsModel) Init() tea.Cmd

func (AlertsModel) IsDetailFocused

func (m AlertsModel) IsDetailFocused() bool

IsDetailFocused returns whether the detail pane has focus

func (AlertsModel) IsDetailLoading

func (m AlertsModel) IsDetailLoading() bool

func (AlertsModel) IsLoadingAlert

func (m AlertsModel) IsLoadingAlert(id string) bool

IsLoadingAlert returns true if the specified alert ID is currently loading

func (*AlertsModel) NextPage

func (m *AlertsModel) NextPage()

func (*AlertsModel) PrevPage

func (m *AlertsModel) PrevPage()

func (AlertsModel) SelectedAlert

func (m AlertsModel) SelectedAlert() *api.Alert

func (AlertsModel) SelectedIndex

func (m AlertsModel) SelectedIndex() int

func (*AlertsModel) SetAlerts

func (m *AlertsModel) SetAlerts(alerts []api.Alert, pagination api.PaginationInfo)

func (*AlertsModel) SetDetailFocused

func (m *AlertsModel) SetDetailFocused(focused bool)

SetDetailFocused sets focus on the detail pane for scrolling

func (*AlertsModel) SetDetailLoading

func (m *AlertsModel) SetDetailLoading(id string)

func (*AlertsModel) SetDimensions

func (m *AlertsModel) SetDimensions(width, height int)

func (*AlertsModel) SetError

func (m *AlertsModel) SetError(err string)

func (*AlertsModel) SetLayout added in v0.2.0

func (m *AlertsModel) SetLayout(layout string)

SetLayout sets the layout direction (horizontal or vertical)

func (*AlertsModel) SetLoading

func (m *AlertsModel) SetLoading(loading bool)

func (*AlertsModel) SetSpinner

func (m *AlertsModel) SetSpinner(spinner string)

func (AlertsModel) TotalCount added in v0.2.0

func (m AlertsModel) TotalCount() int

func (AlertsModel) TotalPages added in v0.2.0

func (m AlertsModel) TotalPages() int

func (AlertsModel) Update

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

func (*AlertsModel) UpdateAlertDetail

func (m *AlertsModel) UpdateAlertDetail(index int, alert *api.Alert)

func (AlertsModel) View

func (m AlertsModel) View() string

type ConfigField added in v0.2.0

type ConfigField int

Config panel fields

const (
	ConfigFieldTimezone ConfigField = iota
	ConfigFieldLanguage
	ConfigFieldLayout
	ConfigFieldButton
)

type ConfigSavedMsg

type ConfigSavedMsg struct {
	Success bool
	Error   string
}

type ConnectionField added in v0.2.0

type ConnectionField int

Connection panel fields

const (
	ConnFieldEndpoint ConnectionField = iota
	ConnFieldAPIKey
	ConnFieldButtons
)

type ConnectionSavedMsg added in v0.2.0

type ConnectionSavedMsg struct {
	Success bool
	Error   string
}

type HelpModel

type HelpModel struct {
	Visible bool
}

func NewHelpModel

func NewHelpModel() HelpModel

func (*HelpModel) Hide

func (m *HelpModel) Hide()

func (*HelpModel) Show

func (m *HelpModel) Show()

func (*HelpModel) Toggle

func (m *HelpModel) Toggle()

func (HelpModel) View

func (m HelpModel) View() string

type IncidentsModel

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

func NewIncidentsModel

func NewIncidentsModel() IncidentsModel

func (*IncidentsModel) ClearDetailLoading

func (m *IncidentsModel) ClearDetailLoading()

func (IncidentsModel) CurrentPage

func (m IncidentsModel) CurrentPage() int

Pagination methods

func (IncidentsModel) GetDetailPlainText added in v0.2.0

func (m IncidentsModel) GetDetailPlainText() string

GetDetailPlainText returns the detail panel content as plain text for clipboard

func (IncidentsModel) GetSortInfo added in v0.2.0

func (m IncidentsModel) GetSortInfo() string

GetSortInfo returns a string describing the current sort

func (IncidentsModel) GetSortParam added in v0.2.0

func (m IncidentsModel) GetSortParam() string

GetSortParam returns the API sort parameter string based on current sort state Returns empty string if sorting is disabled

func (*IncidentsModel) HandleSortMenuKey added in v0.2.0

func (m *IncidentsModel) HandleSortMenuKey(key string) bool

HandleSortMenuKey handles keyboard input for the sort menu Returns true if sorting changed and a reload is needed

func (IncidentsModel) HasNextPage

func (m IncidentsModel) HasNextPage() bool

func (IncidentsModel) HasPrevPage

func (m IncidentsModel) HasPrevPage() bool

func (IncidentsModel) Init

func (m IncidentsModel) Init() tea.Cmd

func (IncidentsModel) IsDetailFocused

func (m IncidentsModel) IsDetailFocused() bool

IsDetailFocused returns whether the detail pane has focus

func (IncidentsModel) IsDetailLoading

func (m IncidentsModel) IsDetailLoading() bool

func (IncidentsModel) IsLoadingIncident

func (m IncidentsModel) IsLoadingIncident(id string) bool

IsLoadingIncident returns true if the specified incident ID is currently loading

func (IncidentsModel) IsSortMenuVisible added in v0.2.0

func (m IncidentsModel) IsSortMenuVisible() bool

IsSortMenuVisible returns whether the sort menu is visible

func (*IncidentsModel) NextPage

func (m *IncidentsModel) NextPage()

func (*IncidentsModel) PrevPage

func (m *IncidentsModel) PrevPage()

func (IncidentsModel) RenderSortMenu added in v0.2.0

func (m IncidentsModel) RenderSortMenu() string

RenderSortMenu renders the sort menu overlay

func (IncidentsModel) SelectedIncident

func (m IncidentsModel) SelectedIncident() *api.Incident

func (IncidentsModel) SelectedIndex

func (m IncidentsModel) SelectedIndex() int

func (*IncidentsModel) SetDetailFocused

func (m *IncidentsModel) SetDetailFocused(focused bool)

SetDetailFocused sets focus on the detail pane for scrolling

func (*IncidentsModel) SetDetailLoading

func (m *IncidentsModel) SetDetailLoading(id string)

func (*IncidentsModel) SetDimensions

func (m *IncidentsModel) SetDimensions(width, height int)

func (*IncidentsModel) SetError

func (m *IncidentsModel) SetError(err string)

func (*IncidentsModel) SetIncidents

func (m *IncidentsModel) SetIncidents(incidents []api.Incident, pagination api.PaginationInfo)

func (*IncidentsModel) SetLayout added in v0.2.0

func (m *IncidentsModel) SetLayout(layout string)

SetLayout sets the layout direction (horizontal or vertical)

func (*IncidentsModel) SetLoading

func (m *IncidentsModel) SetLoading(loading bool)

func (*IncidentsModel) SetSort added in v0.2.0

func (m *IncidentsModel) SetSort(field SortField) bool

SetSort sets the sort field and direction Returns true if the field changed (requiring a reload from API)

func (*IncidentsModel) SetSpinner

func (m *IncidentsModel) SetSpinner(spinner string)

func (*IncidentsModel) ToggleSortMenu added in v0.2.0

func (m *IncidentsModel) ToggleSortMenu()

ToggleSortMenu toggles the visibility of the sort menu

func (IncidentsModel) TotalCount added in v0.2.0

func (m IncidentsModel) TotalCount() int

func (IncidentsModel) TotalPages added in v0.2.0

func (m IncidentsModel) TotalPages() int

func (IncidentsModel) Update

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

func (*IncidentsModel) UpdateIncidentDetail

func (m *IncidentsModel) UpdateIncidentDetail(index int, incident *api.Incident)

func (IncidentsModel) View

func (m IncidentsModel) View() string

type LogsModel

type LogsModel struct {
	Visible bool
	// contains filtered or unexported fields
}

func NewLogsModel

func NewLogsModel() LogsModel

func (*LogsModel) Hide

func (m *LogsModel) Hide()

func (LogsModel) Init

func (m LogsModel) Init() tea.Cmd

func (*LogsModel) Refresh

func (m *LogsModel) Refresh()

func (*LogsModel) SetDimensions

func (m *LogsModel) SetDimensions(width, height int)

func (*LogsModel) Show

func (m *LogsModel) Show()

func (LogsModel) StartAutoRefresh

func (m LogsModel) StartAutoRefresh() tea.Cmd

StartAutoRefresh returns a command to start the auto-refresh ticker

func (*LogsModel) Toggle

func (m *LogsModel) Toggle()

func (LogsModel) Update

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

func (LogsModel) View

func (m LogsModel) View() string

type LogsRefreshMsg

type LogsRefreshMsg struct{}

LogsRefreshMsg triggers a log refresh

type LogsStatusClearMsg

type LogsStatusClearMsg struct{}

LogsStatusClearMsg is sent to clear the status message

type Panel added in v0.2.0

type Panel int

Panel identifiers

const (
	PanelConnection Panel = iota
	PanelConfig
)

type PreferencesSavedMsg added in v0.2.0

type PreferencesSavedMsg struct {
	Success bool
	Error   string
}

type SetupField

type SetupField int

SetupField is kept for backward compatibility with tests

const (
	FieldEndpoint SetupField = iota
	FieldAPIKey
	FieldTimezone
	FieldLanguage
	FieldLayout
	FieldButtons
)

type SetupModel

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

func NewSetupModel

func NewSetupModel() SetupModel

func NewSetupModelWithConfig

func NewSetupModelWithConfig(cfg *config.Config) SetupModel

NewSetupModelWithConfig creates a setup model pre-populated with existing config values

func (SetupModel) ActivePanel added in v0.2.0

func (m SetupModel) ActivePanel() Panel

func (SetupModel) ButtonIndex added in v0.2.0

func (m SetupModel) ButtonIndex() int

func (SetupModel) FocusIndex added in v0.2.0

func (m SetupModel) FocusIndex() SetupField

Backward compatibility methods for tests

func (*SetupModel) HandleConnectionSaved added in v0.2.0

func (m *SetupModel) HandleConnectionSaved(msg ConnectionSavedMsg)

func (*SetupModel) HandlePreferencesSaved added in v0.2.0

func (m *SetupModel) HandlePreferencesSaved(msg PreferencesSavedMsg)

func (*SetupModel) HandleValidationResult

func (m *SetupModel) HandleValidationResult(msg APIKeyValidatedMsg)

func (SetupModel) Init

func (m SetupModel) Init() tea.Cmd

func (SetupModel) IsConfigSaved added in v0.2.0

func (m SetupModel) IsConfigSaved() bool

func (SetupModel) IsConnectionSaved added in v0.2.0

func (m SetupModel) IsConnectionSaved() bool

func (SetupModel) IsTesting

func (m SetupModel) IsTesting() bool

func (SetupModel) LanguageIndex added in v0.2.0

func (m SetupModel) LanguageIndex() int

func (SetupModel) LayoutIndex added in v0.2.0

func (m SetupModel) LayoutIndex() int

func (*SetupModel) SetDimensions

func (m *SetupModel) SetDimensions(width, height int)

func (*SetupModel) SetTesting

func (m *SetupModel) SetTesting(testing bool)

func (SetupModel) TimezoneIndex added in v0.2.0

func (m SetupModel) TimezoneIndex() int

func (SetupModel) Update

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

func (SetupModel) View

func (m SetupModel) View() string

type SortField added in v0.2.0

type SortField int

SortField represents the field to sort by

const (
	SortByNone SortField = iota
	SortByCreated
	SortByUpdated
)

Jump to

Keyboard shortcuts

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