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

Method handleRunCommand

internal/ui/plugins/commandrunner/plugin.go:130–155  ·  view source on GitHub ↗

handleRunCommand shows the command menu for the selected node.

(ctx context.Context, app *components.App, node *api.Node)

Source from the content-addressed store, hash-verified

128
129// handleRunCommand shows the command menu for the selected node.
130func (p *Plugin) handleRunCommand(ctx context.Context, app *components.App, node *api.Node) error {
131 if app == nil {
132 return fmt.Errorf("application context unavailable")
133 }
134
135 if node == nil {
136 return fmt.Errorf("no node selected")
137 }
138
139 if p.runner == nil || !p.runner.Enabled() {
140 return fmt.Errorf("command runner not initialized")
141 }
142
143 p.updateSSHClient(node)
144
145 // Prefer IP for SSH to avoid DNS/host lookups; fall back to node name.
146 targetHost := node.IP
147 if targetHost == "" {
148 targetHost = node.Name
149 }
150
151 // Show command menu
152 p.runner.ShowHostCommandMenu(targetHost, nil)
153
154 return nil
155}
156
157// handleRunContainerCommand shows the command menu for the selected container.
158func (p *Plugin) handleRunContainerCommand(ctx context.Context, app *components.App, node *api.Node, guest *api.VM) error {

Callers

nothing calls this directly

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 3

updateSSHClientMethod · 0.95
EnabledMethod · 0.80
ShowHostCommandMenuMethod · 0.80

Tested by

no test coverage detected