GetSelectedVM returns the currently selected VM.
()
| 202 | |
| 203 | // GetSelectedVM returns the currently selected VM. |
| 204 | func (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. |
| 214 | func (vl *VMList) GetNodeForVM(vm *api.VM) *api.Node { |
no test coverage detected