[pve-devel] [PATCH manager 1/2] ui: bulk start/stop: align capability checks with backend

Fiona Ebner f.ebner at proxmox.com
Wed Mar 1 15:22:19 CET 2023


The backend requires VM.PowerMgmt, not Sys.PowerMgmt for bulk start
and bulk stop.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 www/manager6/node/CmdMenu.js | 4 +++-
 www/manager6/node/Config.js  | 6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/www/manager6/node/CmdMenu.js b/www/manager6/node/CmdMenu.js
index 71548e9c..dc56ef08 100644
--- a/www/manager6/node/CmdMenu.js
+++ b/www/manager6/node/CmdMenu.js
@@ -126,9 +126,11 @@ Ext.define('PVE.node.CmdMenu', {
 	if (!caps.vms['VM.Migrate']) {
 	    me.getComponent('bulkmigrate').setDisabled(true);
 	}
-	if (!caps.nodes['Sys.PowerMgmt']) {
+	if (!caps.vms['VM.PowerMgmt']) {
 	    me.getComponent('bulkstart').setDisabled(true);
 	    me.getComponent('bulkstop').setDisabled(true);
+	}
+	if (!caps.nodes['Sys.PowerMgmt']) {
 	    me.getComponent('wakeonlan').setDisabled(true);
 	}
 	if (!caps.nodes['Sys.Console']) {
diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js
index 9269e892..0cc23fb4 100644
--- a/www/manager6/node/Config.js
+++ b/www/manager6/node/Config.js
@@ -34,13 +34,13 @@ Ext.define('PVE.node.Config', {
 	var actionBtn = Ext.create('Ext.Button', {
 	    text: gettext('Bulk Actions'),
 	    iconCls: 'fa fa-fw fa-ellipsis-v',
-	    disabled: !caps.nodes['Sys.PowerMgmt'] && !caps.vms['VM.Migrate'],
+	    disabled: !caps.vms['VM.PowerMgmt'] && !caps.vms['VM.Migrate'],
 	    menu: new Ext.menu.Menu({
 		items: [
 		    {
 			text: gettext('Bulk Start'),
 			iconCls: 'fa fa-fw fa-play',
-			disabled: !caps.nodes['Sys.PowerMgmt'],
+			disabled: !caps.vms['VM.PowerMgmt'],
 			handler: function() {
 			    Ext.create('PVE.window.BulkAction', {
 				autoShow: true,
@@ -54,7 +54,7 @@ Ext.define('PVE.node.Config', {
 		    {
 			text: gettext('Bulk Shutdown'),
 			iconCls: 'fa fa-fw fa-stop',
-			disabled: !caps.nodes['Sys.PowerMgmt'],
+			disabled: !caps.vms['VM.PowerMgmt'],
 			handler: function() {
 			    Ext.create('PVE.window.BulkAction', {
 				autoShow: true,
-- 
2.30.2






More information about the pve-devel mailing list