From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 4454798A18 for ; Mon, 13 Nov 2023 11:21:25 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 277D0111A5 for ; Mon, 13 Nov 2023 11:20:55 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 13 Nov 2023 11:20:54 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 58FC341A62 for ; Mon, 13 Nov 2023 11:20:54 +0100 (CET) From: Hannes Laimer To: pve-devel@lists.proxmox.com Date: Mon, 13 Nov 2023 11:20:46 +0100 Message-Id: <20231113102046.303005-3-h.laimer@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231113102046.303005-1-h.laimer@proxmox.com> References: <20231113102046.303005-1-h.laimer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.007 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH v2 pve-manager 2/2] ui: add bulk suspend support X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2023 10:21:25 -0000 Signed-off-by: Hannes Laimer --- www/manager6/Utils.js | 1 + www/manager6/node/CmdMenu.js | 15 +++++++++++++++ www/manager6/node/Config.js | 14 ++++++++++++++ www/manager6/window/BulkAction.js | 5 +++-- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index be30393e..139064d1 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -1996,6 +1996,7 @@ Ext.define('PVE.Utils', { spiceshell: ['', gettext('Shell') + ' (Spice)'], startall: ['', gettext('Bulk start VMs and Containers')], stopall: ['', gettext('Bulk shutdown VMs and Containers')], + suspendall: ['', gettext('Suspend all VMs')], unknownimgdel: ['', gettext('Destroy image from unknown guest')], wipedisk: ['Device', gettext('Wipe Disk')], vncproxy: ['VM/CT', gettext('Console')], diff --git a/www/manager6/node/CmdMenu.js b/www/manager6/node/CmdMenu.js index dc56ef08..956adc49 100644 --- a/www/manager6/node/CmdMenu.js +++ b/www/manager6/node/CmdMenu.js @@ -56,6 +56,20 @@ Ext.define('PVE.node.CmdMenu', { }); }, }, + { + text: gettext('Bulk Suspend'), + itemId: 'bulksuspend', + iconCls: 'fa fa-fw fa-download', + handler: function() { + Ext.create('PVE.window.BulkAction', { + nodename: this.up('menu').nodename, + title: gettext('Bulk Suspend'), + btnText: gettext('Suspend'), + action: 'suspendall', + autoShow: true, + }); + }, + }, { text: gettext('Bulk Migrate'), itemId: 'bulkmigrate', @@ -129,6 +143,7 @@ Ext.define('PVE.node.CmdMenu', { if (!caps.vms['VM.PowerMgmt']) { me.getComponent('bulkstart').setDisabled(true); me.getComponent('bulkstop').setDisabled(true); + me.getComponent('bulksuspend').setDisabled(true); } if (!caps.nodes['Sys.PowerMgmt']) { me.getComponent('wakeonlan').setDisabled(true); diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js index 6ed2172a..ac5e6b25 100644 --- a/www/manager6/node/Config.js +++ b/www/manager6/node/Config.js @@ -65,6 +65,20 @@ Ext.define('PVE.node.Config', { }); }, }, + { + text: gettext('Bulk Suspend'), + iconCls: 'fa fa-fw fa-download', + disabled: !caps.vms['VM.PowerMgmt'], + handler: function() { + Ext.create('PVE.window.BulkAction', { + autoShow: true, + nodename: nodename, + title: gettext('Bulk Suspend'), + btnText: gettext('Suspend'), + action: 'suspendall', + }); + }, + }, { text: gettext('Bulk Migrate'), iconCls: 'fa fa-fw fa-send-o', diff --git a/www/manager6/window/BulkAction.js b/www/manager6/window/BulkAction.js index 5f76ef7a..c8132753 100644 --- a/www/manager6/window/BulkAction.js +++ b/www/manager6/window/BulkAction.js @@ -10,7 +10,7 @@ Ext.define('PVE.window.BulkAction', { }, border: false, - // the action to set, currently there are: `startall`, `migrateall`, `stopall` + // the action to set, currently there are: `startall`, `migrateall`, `stopall`, `suspendall` action: undefined, submit: function(params) { @@ -144,6 +144,7 @@ Ext.define('PVE.window.BulkAction', { }; let defaultStatus = me.action === 'migrateall' ? '' : me.action === 'startall' ? 'stopped' : 'running'; + let defaultType = me.action === 'suspendall' ? 'qemu' : ''; let statusMap = []; let poolMap = []; @@ -318,7 +319,7 @@ Ext.define('PVE.window.BulkAction', { fieldLabel: gettext("Type"), emptyText: gettext('All'), editable: false, - value: '', + value: defaultType, store: [ ['', gettext('All')], ['lxc', gettext('CT')], -- 2.39.2