ui: backup restore: add start-after-restore checkbox

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@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-12-03 10:51:10 +01:00 committed by Dominik Csapak
parent a331258a87
commit 24c55f4143

View File

@ -62,16 +62,29 @@ Ext.define('PVE.window.Restore', {
}
},
{
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
}
},
{
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;