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>
22 lines
496 B
JavaScript
22 lines
496 B
JavaScript
Ext.define('PVE.controller.StorageEdit', {
|
|
extend: 'Ext.app.ViewController',
|
|
alias: 'controller.storageEdit',
|
|
control: {
|
|
'field[name=content]': {
|
|
change: function(field, value) {
|
|
var hasBackups = Ext.Array.contains(value, 'backup');
|
|
var maxfiles = this.lookupReference('maxfiles');
|
|
if (!maxfiles) {
|
|
return;
|
|
}
|
|
|
|
if (!hasBackups) {
|
|
// clear values which will never be submitted
|
|
maxfiles.reset();
|
|
}
|
|
maxfiles.setDisabled(!hasBackups);
|
|
}
|
|
}
|
|
}
|
|
});
|