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

Method currentSelectionForLimit

internal/ui/plugins/ansible/plugin.go:2480–2502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2478}
2479
2480func (p *Plugin) currentSelectionForLimit() (*api.Node, *api.VM) {
2481 currentPage, _ := p.app.Pages().GetFrontPage()
2482 switch currentPage {
2483 case api.PageGuests:
2484 if vm := p.app.VMList().GetSelectedVM(); vm != nil {
2485 return nil, vm
2486 }
2487 case api.PageNodes:
2488 if node := p.app.NodeList().GetSelectedNode(); node != nil {
2489 return node, nil
2490 }
2491 }
2492
2493 // Fallback for modal-driven paths where front page may be plugin-owned.
2494 if vm := p.app.VMList().GetSelectedVM(); vm != nil {
2495 return nil, vm
2496 }
2497 if node := p.app.NodeList().GetSelectedNode(); node != nil {
2498 return node, nil
2499 }
2500
2501 return nil, nil
2502}
2503
2504func (p *Plugin) resolveNodeUser() string {
2505 cfg := p.app.Config()

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 5

VMListMethod · 0.80
NodeListMethod · 0.80
PagesMethod · 0.65
GetSelectedVMMethod · 0.65
GetSelectedNodeMethod · 0.65

Tested by

no test coverage detected