MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / showSetupAssistant

Method showSetupAssistant

internal/ui/plugins/ansible/plugin.go:2243–2275  ·  view source on GitHub ↗
(inventory coreansible.InventoryResult, onDone func())

Source from the content-addressed store, hash-verified

2241}
2242
2243func (p *Plugin) showSetupAssistant(inventory coreansible.InventoryResult, onDone func()) {
2244 pages := p.app.Pages()
2245 pages.RemovePage(menuPageName)
2246
2247 text := tview.NewTextView()
2248 text.SetBorder(true)
2249 text.SetBorderColor(theme.Colors.Border)
2250 text.SetTitle(" SSH Setup Guide ")
2251 text.SetTitleColor(theme.Colors.Primary)
2252 text.SetDynamicColors(true)
2253 text.SetWrap(true)
2254 text.SetWordWrap(true)
2255 text.SetScrollable(true)
2256 text.SetText(buildSetupGuide(inventory))
2257
2258 closeView := func() {
2259 pages.RemovePage(setupPageName)
2260 if onDone != nil {
2261 onDone()
2262 }
2263 }
2264
2265 text.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
2266 if isBackKey(event) || (event.Key() == tcell.KeyRune && (event.Rune() == 'q' || event.Rune() == 'Q')) {
2267 closeView()
2268 return nil
2269 }
2270 return event
2271 })
2272
2273 pages.AddPage(setupPageName, p.centerModal(text, 110, 28), true, true)
2274 p.app.SetFocus(text)
2275}
2276
2277func (p *Plugin) showOutput(title, content string, onDone func()) {
2278 pages := p.app.Pages()

Callers 1

showMainMenuMethod · 0.95

Implementers 4

Plugininternal/ui/plugins/ansible/plugin.go
Plugininternal/ui/plugins/communityscripts/p
Plugininternal/ui/plugins/guestlist/plugin.g
Plugininternal/ui/plugins/commandrunner/plug

Calls 7

centerModalMethod · 0.95
buildSetupGuideFunction · 0.85
isBackKeyFunction · 0.70
PagesMethod · 0.65
SetTitleMethod · 0.65
SetFocusMethod · 0.65
SetTextMethod · 0.45

Tested by

no test coverage detected