while the command itself is 'suspend', the task description
is 'qmpause', so simply add a parameter and overwrite it for the pause
menu item

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 www/manager6/qemu/CmdMenu.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/www/manager6/qemu/CmdMenu.js b/www/manager6/qemu/CmdMenu.js
index fa75ad82..ccc5f74d 100644
--- a/www/manager6/qemu/CmdMenu.js
+++ b/www/manager6/qemu/CmdMenu.js
@@ -21,8 +21,9 @@ Ext.define('PVE.qemu.CmdMenu', {
                failure: (response, opts) => Ext.Msg.alert(gettext('Error'), 
response.htmlStatus),
            });
        };
-       let confirmedVMCommand = (cmd, params) => {
-           let msg = Proxmox.Utils.format_task_description(`qm${cmd}`, 
info.vmid);
+       let confirmedVMCommand = (cmd, params, confirmTask) => {
+           let task = confirmTask || `qm${cmd}`;
+           let msg = Proxmox.Utils.format_task_description(task, info.vmid);
            Ext.Msg.confirm(gettext('Confirm'), msg, btn => {
                if (btn === 'yes') {
                    vm_command(cmd, params);
@@ -65,7 +66,7 @@ Ext.define('PVE.qemu.CmdMenu', {
                iconCls: 'fa fa-fw fa-pause',
                hidden: stopped || suspended,
                disabled: stopped || suspended,
-               handler: () => confirmedVMCommand('suspend'),
+               handler: () => confirmedVMCommand('suspend', undefined, 
'qmpause'),
            },
            {
                text: gettext('Hibernate'),
-- 
2.20.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to