controller: StorageEdit: check if 'maxfiles' could be looked up

Allows to extend our, in the ext patch introduced, storage base class
to use the controller for all storage plugins without breaking those
which cannot host backups - i.e., all block based storages

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2018-03-27 14:19:45 +02:00 committed by Dominik Csapak
parent bf855846f2
commit cf64423cdd

View File

@ -6,6 +6,9 @@ Ext.define('PVE.controller.StorageEdit', {
change: function(field, value) { change: function(field, value) {
var hasBackups = Ext.Array.contains(value, 'backup'); var hasBackups = Ext.Array.contains(value, 'backup');
var maxfiles = this.lookupReference('maxfiles'); var maxfiles = this.lookupReference('maxfiles');
if (!maxfiles) {
return;
}
if (!hasBackups) { if (!hasBackups) {
// clear values which will never be submitted // clear values which will never be submitted