Documentation
¶
Index ¶
- Constants
- Variables
- func AddNewSlide(tui *TUI, name string, command string, args []string, isCluster bool)
- func AddSOPSlide(name string, textView *tview.TextView, tui *TUI)
- func InitTerminalMux(tui *TUI, kiteTab *TerminalTab) *tview.Flex
- func NextSlide(tui *TUI)
- func PreviousSlide(tui *TUI)
- func RemoveSlide(s int, tui *TUI)
- func SwitchToSlide(slideNum int, tui *TUI)
- func ViewAlertSOP(tui *TUI, URL string)
- type TUI
- func (tui *TUI) Init()
- func (tui *TUI) InitAlertDataSecondaryView()
- func (tui *TUI) InitAlertsSecondaryView()
- func (tui *TUI) InitAlertsUI(alerts []pdcli.Alert, tableTitle string, pageTitle string)
- func (tui *TUI) InitIncidentsUI(incidents [][]string, tableTitle string, pageTitle string, isSelectable bool)
- func (tui *TUI) InitOnCallSecondaryView(user string, primary string, secondary string)
- func (tui *TUI) InitTable(headers []string, data [][]string, isSelectable bool, ...) *tview.Table
- func (tui *TUI) SeedAckIncidentsUI()
- func (tui *TUI) SeedAlertsUI()
- func (tui *TUI) SeedIncidentsUI()
- func (tui *TUI) SetAlertsTableEvents(alerts []pdcli.Alert)
- func (tui *TUI) SetIncidentsTableEvents()
- func (t *TUI) StartApp() error
- type TerminalTab
Constants ¶
const ( // Text Format TitleFmt = " [lightcyan::b]%s " // Table Titles AlertsTableTitle = "[ ALERTS ]" TrigerredAlertsTableTitle = "[ TRIGERRED ALERTS ]" HighAlertsTableTitle = "[ TRIGERRED ALERTS - HIGH ]" LowAlertsTableTitle = "[ TRIGERRED ALERTS - LOW ]" AlertMetadataViewTitle = "[ ALERT DATA ]" IncidentsTableTitle = "[ TRIGERRED INCIDENTS ]" AckIncidentsTableTitle = "[ ACKNOWLEDGED INCIDENTS ]" OncallTableTitle = "ONCALL" NextOncallTableTitle = "[ NEXT ONCALL ]" AllTeamsOncallTableTitle = "[ ALL TEAMS ONCALL ]" // Page Titles AlertsPageTitle = "Alerts" AlertDataPageTitle = "Metadata" AlertMetadata = "AlertData" TrigerredAlertsPageTitle = "Trigerred" HighAlertsPageTitle = "High Alerts" LowAlertsPageTitle = "Low Alerts" IncidentsPageTitle = "Incidents" AckIncidentsPageTitle = "AckIncidents" OncallPageTitle = "Oncall Layer" NextOncallPageTitle = "Next Oncall" AllTeamsOncallPageTitle = "All Teams Oncall" ServiceLogsPageTitle = "Service Logs" //Footer // Colors TableTitleColor = tcell.ColorLightCyan BorderColor = tcell.ColorLightGray InfoTextColor = tcell.ColorLightSlateGray ErrorTextColor = tcell.ColorRed PromptTextColor = tcell.ColorLightGreen LoggerTextColor = tcell.ColorGreen )
Variables ¶
var CurrentActivePage int = 0
var CursorPos int
var TotalPageCount int = 0
Functions ¶
func AddNewSlide ¶ added in v0.1.0
Adds a slide to the end of currently present slides
func AddSOPSlide ¶ added in v0.1.0
Adds a SOP slide to the end of currently present slides
func InitTerminalMux ¶ added in v0.1.0
func InitTerminalMux(tui *TUI, kiteTab *TerminalTab) *tview.Flex
Init the Layout for Terminal Multiplexer
func RemoveSlide ¶ added in v0.1.0
Remove the slide with the given index Exit the app if only one slide is present
func SwitchToSlide ¶ added in v0.1.0
Navigate to the specified slide
Types ¶
type TUI ¶
type TUI struct { // Main UI elements App *tview.Application AlertMetadata *tview.TextView Table *tview.Table IncidentsTable *tview.Table NextOncallTable *tview.Table AllTeamsOncallTable *tview.Table Pages *tview.Pages SecondaryWindow *tview.TextView LogWindow *tview.TextView Layout *tview.Flex ServiceLogView *tview.TextView FrontPage string // API related Client client.PagerDutyClient IncidentOpts pagerduty.ListIncidentsOptions Alerts []pdcli.Alert // Internals SelectedIncidents map[string]string Incidents [][]string AckIncidents []string AssignedTo string Username string Role string Columns string ClusterID string ClusterName string CurrentOnCallPage int // SOP Related SOPLink string NumLinks int SOPView *tview.TextView // Multi-Window Terminals Related TerminalLayout *tview.Flex TerminalPages *tview.Pages TerminalPageBar *tview.TextView TerminalTabs []TerminalTab TerminalUIRegionIDs []int TerminalInputBuffer []rune TerminalLastChars []rune }
func (*TUI) InitAlertDataSecondaryView ¶ added in v0.1.0
func (tui *TUI) InitAlertDataSecondaryView()
func (*TUI) InitAlertsSecondaryView ¶ added in v0.1.0
func (tui *TUI) InitAlertsSecondaryView()
func (*TUI) InitAlertsUI ¶
InitAlertsUI initializes TUI table component. It adds the returned table as a new TUI page view.
func (*TUI) InitIncidentsUI ¶
func (tui *TUI) InitIncidentsUI(incidents [][]string, tableTitle string, pageTitle string, isSelectable bool)
InitIncidentsUI initializes TUI table component. It adds the returned table as a new TUI page view.
func (*TUI) InitOnCallSecondaryView ¶ added in v0.1.0
func (*TUI) InitTable ¶
func (tui *TUI) InitTable(headers []string, data [][]string, isSelectable bool, isFirstColSelectable bool, title string) *tview.Table
InitTable initializes TUI table component with the given data and retuns a tview table primitive.
func (*TUI) SeedAckIncidentsUI ¶
func (tui *TUI) SeedAckIncidentsUI()
SeedAckIncidentsUI fetches acknlowedged incidents and initializes a TUI table/page component.
func (*TUI) SeedAlertsUI ¶ added in v0.0.2
func (tui *TUI) SeedAlertsUI()
SeedIncidentsUI fetches acknowledged incident alerts and initializes a TUI table/page component.
func (*TUI) SeedIncidentsUI ¶
func (tui *TUI) SeedIncidentsUI()
SeedIncidentsUI fetches trigerred incidents and initializes a TUI table/page component.
func (*TUI) SetAlertsTableEvents ¶
SetAlertsTableEvents is the event handler for the alerts table. It handles the program flow when a table selection is made.
func (*TUI) SetIncidentsTableEvents ¶
func (tui *TUI) SetIncidentsTableEvents()
SetIncidentsTableEvents is the event handler for the incidents table in ack mode. It handles the program flow when a table selection is made.
type TerminalTab ¶ added in v0.1.0
type TerminalTab struct {
// contains filtered or unexported fields
}
Declares the tab struct
func InitKiteTab ¶ added in v0.1.0
func InitKiteTab(tui *TUI, layout *tview.Flex) *TerminalTab
Creates and return a new kite tab
func InitSOPTab ¶ added in v0.1.0
func InitSOPTab(name string, layout *tview.TextView, tui *TUI) *TerminalTab
Creates and returns a SOP tab