func (h *HelpPanel) Init(app *App) { h.Panel.Init(app) // No, we don't have context-sensitive help. h.text = views.NewTextArea() h.text.SetLines([]string{ "Supported keys (not all keys available in all contexts)", "", " <ESC> : return to main screen", " <CTRL-C> : quit", " <CTRL-L> : refresh the screeen", " <H> : show this help", " <UP>, <DOWN> : navigation", " <PGUP>, <PGDN>", " <HOME>, <END>", " <E> : enable selected service", " <D> : disable selected service", " <I> : view detailed information for service", " <R> : restart selected service", " <C> : clear faults on selected service", " <L> : view log for selected service", "", "This program is distributed under the Apache 2.0 License", "Copyright 2016 The Govisor Authors", }) h.SetContent(h.text) }
func NewInfoPanel(app *App) *InfoPanel { ipanel := &InfoPanel{} ipanel.Panel.Init(app) ipanel.text = views.NewTextArea() ipanel.text.EnableCursor(false) ipanel.SetContent(ipanel.text) ipanel.text.SetStyle(tcell.StyleDefault. Foreground(tcell.ColorSilver).Background(tcell.ColorBlack)) // We don't change the keybar, so set it once ipanel.SetKeys([]string{"[Q] Quit", "[H] Help"}) return ipanel }
func NewLogPanel(app *App) *LogPanel { p := &LogPanel{} p.Panel.Init(app) // We don't change the keybar, so set it once p.SetKeys([]string{"[Q] Quit", "[H] Help"}) p.text = views.NewTextArea() p.text.EnableCursor(false) p.text.SetStyle(tcell.StyleDefault. Foreground(tcell.ColorSilver).Background(tcell.ColorBlack)) p.SetContent(p.text) return p }