[pve-devel] [PATCH manager] fix #3470: ui: qemu/CmdMenu: fix confirm message for 'pause' cmd

Dominik Csapak d.csapak at proxmox.com
Wed Jun 16 08:01:51 CEST 2021


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 at 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






More information about the pve-devel mailing list