[pve-devel] [PATCH v3 manager 2/2] add lxc restart warning to bulk migration screen

Oguz Bektas o.bektas at proxmox.com
Mon Feb 18 13:40:27 CET 2019


only show warning in migration window and when a running lxc container
is chosen

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
Co-Authored by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/window/BulkAction.js | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/www/manager6/window/BulkAction.js b/www/manager6/window/BulkAction.js
index 2ec9b9c9..dd200bee 100644
--- a/www/manager6/window/BulkAction.js
+++ b/www/manager6/window/BulkAction.js
@@ -80,6 +80,13 @@ Ext.define('PVE.window.BulkAction', {
 		    value: 1,
 		    fieldLabel: gettext('Parallel jobs'),
 		    allowBlank: false
+		},
+		{
+		    itemId: 'lxcwarning',
+		    xtype: 'displayfield',
+		    userCls: 'pve-hint',
+		    value: 'Warning: Running CTs will be migrated in Restart Mode.',
+		    hidden: true // only visible if running container chosen
 		}
 	    );
 	} else if (me.action === 'startall') {
@@ -99,7 +106,18 @@ Ext.define('PVE.window.BulkAction', {
 	    selectAll: true,
 	    allowBlank: false,
 	    nodename: me.nodename,
-	    action: me.action
+	    action: me.action,
+	    listeners: {
+		selectionchange: function(vmselector, records) {
+		    if (me.action == 'migrateall') {
+			let showWarning = records.some(function(item) {
+			    return (item.data.type == 'lxc' &&
+				item.data.status == 'running');
+			});
+		    me.down('#lxcwarning').setVisible(showWarning);
+		    }
+		}
+	    }
 	});
 
 	me.formPanel = Ext.create('Ext.form.Panel', {
-- 
2.11.0





More information about the pve-devel mailing list