MCPcopy Create free account
hub / github.com/Macmod/godap / openExplorerSettingsForm

Function openExplorerSettingsForm

tui/explorer.go:568–614  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

566}
567
568func openExplorerSettingsForm() {
569 currentFocus := app.GetFocus()
570
571 baseDNField := tview.NewInputField().
572 SetLabel("Base DN").
573 SetText(explorerBaseDN)
574 assignInputFieldTheme(baseDNField)
575
576 filterField := tview.NewInputField().
577 SetLabel("Expand Filter").
578 SetText(SearchFilter)
579 assignInputFieldTheme(filterField)
580
581 attrsField := tview.NewInputField().
582 SetLabel("Attributes").
583 SetText(explorerAttrsList)
584 assignInputFieldTheme(attrsField)
585
586 form := NewXForm()
587 form.
588 AddFormItem(baseDNField).
589 AddFormItem(filterField).
590 AddFormItem(attrsField).
591 AddButton("Go Back", func() {
592 app.SetRoot(appPanel, true).SetFocus(currentFocus)
593 }).
594 AddButton("Query", func() {
595 newAttrsList := attrsField.GetText()
596 warnAttrsList(newAttrsList, currentFocus, func() {
597 explorerBaseDN = baseDNField.GetText()
598 SearchFilter = filterField.GetText()
599 explorerAttrsList = newAttrsList
600 app.SetRoot(appPanel, true).SetFocus(currentFocus)
601 reloadExplorerPage()
602 })
603 })
604
605 form.SetTitle("Explorer Settings").SetBorder(true)
606 form.SetInputCapture(handleEscape(currentFocus))
607
608 centeredForm := tview.NewGrid().
609 SetColumns(0, 60, 0).
610 SetRows(0, 11, 0).
611 AddItem(form, 1, 1, 1, 1, 0, 0, true)
612
613 app.SetRoot(centeredForm, true).SetFocus(form)
614}
615
616func explorerPageKeyHandler(event *tcell.EventKey) *tcell.EventKey {
617 if event.Key() == tcell.KeyTab || event.Key() == tcell.KeyBacktab {

Callers 1

explorerPageKeyHandlerFunction · 0.85

Calls 5

assignInputFieldThemeFunction · 0.85
NewXFormFunction · 0.85
warnAttrsListFunction · 0.85
reloadExplorerPageFunction · 0.85
handleEscapeFunction · 0.85

Tested by

no test coverage detected