[pve-devel] [PATCH manager 2/2] ui: backup restore: add start-after-restore checkbox

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 3 10:51:10 CET 2019


Restore may be a long running operation, as it goes over the common
create API path we can reuse the "start after create" for a "start
after restore" for free.

Add this as hbox layout, as else it looks like a lot of wasted space
in the right side of the window, especially when restoring a CT
backup (were the "unprivileged" checkbox is additionally there).

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/window/Restore.js | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/www/manager6/window/Restore.js b/www/manager6/window/Restore.js
index 4eaf25f6..fe40fa2e 100644
--- a/www/manager6/window/Restore.js
+++ b/www/manager6/window/Restore.js
@@ -62,16 +62,29 @@ Ext.define('PVE.window.Restore', {
 		}
 	    },
 	    {
-		xtype: 'proxmoxcheckbox',
-		name: 'unique',
-		fieldLabel: gettext('Unique'),
-		hidden: !!me.vmid,
-		autoEl: {
-		    tag: 'div',
-		    'data-qtip': gettext('Autogenerate unique properties, e.g., MAC addresses')
+		xtype: 'fieldcontainer',
+		layout: 'hbox',
+		items: [{
+		    xtype: 'proxmoxcheckbox',
+		    name: 'unique',
+		    fieldLabel: gettext('Unique'),
+		    hidden: !!me.vmid,
+		    flex: 1,
+		    autoEl: {
+			tag: 'div',
+			'data-qtip': gettext('Autogenerate unique properties, e.g., MAC addresses')
+		    },
+		    checked: false
 		},
-		checked: false
-	    }
+		{
+		    xtype: 'proxmoxcheckbox',
+		    name: 'start',
+		    flex: 1,
+		    fieldLabel: gettext('Start after restore'),
+		    labelWidth: 105,
+		    checked: false
+		}],
+	    },
 	];
 
 	/*jslint confusion: true*/
@@ -130,6 +143,7 @@ Ext.define('PVE.window.Restore', {
 		    force: me.vmid ? 1 : 0
 		};
 		if (values.unique) { params.unique = 1; }
+		if (values.start) { params.start = 1; }
 
 		if (values.bwlimit !== undefined) {
 		    params.bwlimit = values.bwlimit * 1024;
-- 
2.20.1





More information about the pve-devel mailing list