]> git.proxmox.com Git - pve-manager.git/commitdiff
change Start/Stop/Migrate all to Bulk actions
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 5 Jan 2017 11:25:03 +0000 (12:25 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 5 Jan 2017 14:59:44 +0000 (15:59 +0100)
this uses the new vmselector and the new vmid filter in the backend
to allow starting/stopping/migrating selected vms instead of all

by default all vms are selected to have the same default behaviour

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Makefile
www/manager6/node/Config.js

index ae0abe2f4cc966e7fe6351a6b85efd0aa9e7ac2b..8350185cdef09af075875613954eb3b227fdd3aa 100644 (file)
@@ -68,6 +68,7 @@ JSSRC=                                                        \
        form/FirewallPolicySelector.js                  \
        form/GlobalSearchField.js                       \
        form/QemuBiosSelector.js                        \
+       form/VMSelector.js                      \
        dc/Tasks.js                                     \
        dc/Log.js                                       \
        panel/StatusPanel.js                            \
@@ -128,7 +129,7 @@ JSSRC=                                                      \
        node/APT.js                                     \
        node/Config.js                                  \
        window/Migrate.js                               \
-       window/MigrateAll.js                            \
+       window/BulkAction.js                            \
        qemu/Monitor.js                                 \
        qemu/Summary.js                                 \
        qemu/OSTypeEdit.js                              \
index e30e106879a9436a36f20df2fccaa514dbcbfb8d..f41616770f38a683ba5980df67a35eca57d59705 100644 (file)
@@ -32,59 +32,46 @@ Ext.define('PVE.node.Config', {
        };
 
        var actionBtn = Ext.create('Ext.Button', {
-           text: gettext('More'),
+           text: gettext('Bulk Actions'),
            iconCls: 'fa fa-fw fa-ellipsis-v',
            disabled: !caps.nodes['Sys.PowerMgmt'],
            menu: new Ext.menu.Menu({
                items: [
                    {
-                       text: gettext('Start all VMs and Containers'),
+                       text: gettext('Bulk Start'),
                        iconCls: 'fa fa-fw fa-play',
                        handler: function() {
-                           var msg = gettext('Start all VMs and Containers') + ' (' + gettext('Node') + " '" + nodename + "')";
-                           Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
-                               if (btn !== 'yes') {
-                                   return;
-                               }
-                               PVE.Utils.API2Request({
-                                   params: { force: 1 },
-                                   url: '/nodes/' + nodename + '/startall',
-                                   method: 'POST',
-                                   waitMsgTarget: me,
-                                   failure: function(response, opts) {
-                                       Ext.Msg.alert('Error', response.htmlStatus);
-                                   }
-                               });
+                           var win = Ext.create('PVE.window.BulkAction', {
+                               nodename: nodename,
+                               title: gettext('Bulk Start'),
+                               btnText: gettext('Start'),
+                               action: 'startall'
                            });
+                           win.show();
                        }
                    },
                    {
-                       text: gettext('Stop all VMs and Containers'),
-                       iconCls: 'fa fa-fw fa-stop fa-red',
+                       text: gettext('Bulk Stop'),
+                       iconCls: 'fa fa-fw fa-stop',
                        handler: function() {
-                           var msg = gettext('Stop all VMs and Containers') + ' (' + gettext('Node') + " '" + nodename + "')";
-                           Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
-                               if (btn !== 'yes') {
-                                   return;
-                               }
-
-                               PVE.Utils.API2Request({
-                                   url: '/nodes/' + nodename + '/stopall',
-                                   method: 'POST',
-                                   waitMsgTarget: me,
-                                   failure: function(response, opts) {
-                                       Ext.Msg.alert('Error', response.htmlStatus);
-                                   }
-                               });
+                           var win = Ext.create('PVE.window.BulkAction', {
+                               nodename: nodename,
+                               title: gettext('Bulk Stop'),
+                               btnText: gettext('Stop'),
+                               action: 'stopall'
                            });
+                           win.show();
                        }
                    },
                    {
-                       text: gettext('Migrate all VMs and Containers'),
+                       text: gettext('Bulk Migrate'),
                        iconCls: 'fa fa-fw fa-send-o',
                        handler: function() {
-                           var win = Ext.create('PVE.window.MigrateAll', {
-                               nodename: nodename
+                           var win = Ext.create('PVE.window.BulkAction', {
+                               nodename: nodename,
+                               title: gettext('Bulk Migrate'),
+                               btnText: gettext('Migrate'),
+                               action: 'migrateall'
                            });
                            win.show();
                        }