mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-07 12:10:03 +00:00

This controller will display the 'Max Backups' field only if the storage can hold backups. Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
19 lines
459 B
JavaScript
19 lines
459 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 (!hasBackups) {
|
|
// clear values which will never be submitted
|
|
maxfiles.reset();
|
|
}
|
|
maxfiles.setDisabled(!hasBackups);
|
|
}
|
|
}
|
|
}
|
|
});
|