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

Method GetSelectedVM

internal/ui/components/vm_list.go:204–211  ·  view source on GitHub ↗

GetSelectedVM returns the currently selected VM.

()

Source from the content-addressed store, hash-verified

202
203// GetSelectedVM returns the currently selected VM.
204func (vl *VMList) GetSelectedVM() *api.VM {
205 idx := vl.GetCurrentItem()
206 if idx >= 0 && idx < len(vl.vms) {
207 return vl.vms[idx]
208 }
209
210 return nil
211}
212
213// GetNodeForVM returns the node object for a given VM by looking it up from the app's node list.
214func (vl *VMList) GetNodeForVM(vm *api.VM) *api.Node {

Callers 2

SetAppMethod · 0.95
SetVMsMethod · 0.95

Calls 1

GetCurrentItemMethod · 0.65

Tested by

no test coverage detected