mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-05 20:40:21 +00:00
Improve storage selection on restore
Previously, the blank '' would be passed along and lead to a parameter verfication failure. For LXC the default behavior in the backend is to use 'local', so disallow blank and auto-select the first storage supporting'rootdir' instead. For QEMU the default behavior in the backend is to use the original layout from the backup configuration file, which makes sense to use as the default in the GUI as well. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
7ddcb3afda
commit
6fe863ba7e
@ -24,7 +24,11 @@ Ext.define('PVE.window.Restore', {
|
||||
value: '',
|
||||
fieldLabel: gettext('Storage'),
|
||||
storageContent: (me.vmtype === 'lxc') ? 'rootdir' : 'images',
|
||||
allowBlank: true
|
||||
// when restoring a container without specifying a storage, the backend defaults
|
||||
// to 'local', which is unintuitive and 'rootdir' might not even be allowed on it
|
||||
allowBlank: me.vmtype !== 'lxc',
|
||||
emptyText: (me.vmtype === 'lxc') ? '' : gettext('From backup configuration'),
|
||||
autoSelect: me.vmtype === 'lxc',
|
||||
});
|
||||
|
||||
var IDfield;
|
||||
@ -135,16 +139,15 @@ Ext.define('PVE.window.Restore', {
|
||||
var submitBtn = Ext.create('Ext.Button', {
|
||||
text: gettext('Restore'),
|
||||
handler: function(){
|
||||
var storage = storagesel.getValue();
|
||||
var values = form.getValues();
|
||||
|
||||
var params = {
|
||||
storage: storage,
|
||||
vmid: me.vmid || values.vmid,
|
||||
force: me.vmid ? 1 : 0
|
||||
};
|
||||
if (values.unique) { params.unique = 1; }
|
||||
if (values.start) { params.start = 1; }
|
||||
if (values.storage) { params.storage = values.storage; }
|
||||
|
||||
if (values.bwlimit !== undefined) {
|
||||
params.bwlimit = values.bwlimit;
|
||||
|
Loading…
Reference in New Issue
Block a user