forked from TrueCloudLab/frostfs-node
[#1223] lens/tui: Add app help
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
parent
ed396448ac
commit
e655336390
4 changed files with 179 additions and 1 deletions
|
@ -60,6 +60,8 @@ type UI struct {
|
|||
loadingBar *LoadingBar
|
||||
helpBar *tview.TextView
|
||||
|
||||
helpPage *HelpPage
|
||||
|
||||
searchErrorBar *tview.TextView
|
||||
|
||||
isSearching bool
|
||||
|
@ -275,7 +277,17 @@ func (ui *UI) draw(screen tcell.Screen) {
|
|||
|
||||
switch {
|
||||
case ui.isShowingHelp:
|
||||
pageToDraw = ui.pageStub
|
||||
if ui.helpPage == nil {
|
||||
var filters []string
|
||||
for f := range ui.filters {
|
||||
filters = append(filters, f)
|
||||
}
|
||||
for f := range ui.compositeFilters {
|
||||
filters = append(filters, f)
|
||||
}
|
||||
ui.helpPage = NewHelpPage(filters, ui.filterHints)
|
||||
}
|
||||
pageToDraw = ui.helpPage
|
||||
case ui.mountedPage != nil:
|
||||
pageToDraw = ui.mountedPage
|
||||
default:
|
||||
|
@ -429,6 +441,7 @@ func (ui *UI) handleInputOnShowingHelp(event *tcell.EventKey) {
|
|||
case k == tcell.KeyRune && r == 'q':
|
||||
ui.stop()
|
||||
default:
|
||||
ui.helpPage.InputHandler()(event, func(tview.Primitive) {})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue