ShowVMCommandMenu displays a list of commands tailored to a VM's OS.
(vm VM, onClose func())
| 48 | |
| 49 | // ShowVMCommandMenu displays a list of commands tailored to a VM's OS. |
| 50 | func (u *UIManager) ShowVMCommandMenu(vm VM, onClose func()) { |
| 51 | target := fmt.Sprintf("%s/%d", vm.Node, vm.ID) |
| 52 | u.vmTargets[target] = vm |
| 53 | commands := u.executor.GetAllowedVMCommands(vm) |
| 54 | u.showCommandMenu(TargetVM, target, commands, onClose) |
| 55 | } |
| 56 | |
| 57 | func (u *UIManager) showCommandMenu(targetType TargetType, target string, commands []string, onClose func()) { |
| 58 | if len(commands) == 0 { |
no test coverage detected