]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: add bulk suspend support
authorHannes Laimer <h.laimer@proxmox.com>
Mon, 13 Nov 2023 10:20:46 +0000 (11:20 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 13 Nov 2023 13:14:08 +0000 (14:14 +0100)
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
www/manager6/Utils.js
www/manager6/node/CmdMenu.js
www/manager6/node/Config.js
www/manager6/window/BulkAction.js

index 9b77ebd3ebe966c6a3f9dfef91427e98846bceb2..9f44e560140ea82d4406644c890758281ad6bd90 100644 (file)
@@ -2000,6 +2000,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')],
index 1dbcd781addba9648f1d2aae2c73daeb53f37885..7bdfebc593c4124a97eae538fa5ca5d1e50c499e 100644 (file)
@@ -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);
index 6deafcdf60182c90d7d16a846e35dbd42d5e50a4..6ad48544f7aae1c75d23a668eb0c4f996318b984 100644 (file)
@@ -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',
index 5f76ef7a43f64f070e13a20867c6d881f54083be..c8132753e1ff554e5c7ad97fe8af019b540368c1 100644 (file)
@@ -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')],