]> git.proxmox.com Git - pve-manager.git/commitdiff
fix #3470: ui: qemu/CmdMenu: fix confirm message for 'pause' cmd
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 16 Jun 2021 06:01:51 +0000 (08:01 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Jun 2021 15:21:52 +0000 (17:21 +0200)
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.csapak@proxmox.com>
www/manager6/qemu/CmdMenu.js

index fa75ad82197a58c2ccf67ba5ba8f16bbc7924cd0..ccc5f74d4e4b4c73f6422d5d48dbbb28a3c858db 100644 (file)
@@ -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'),