mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-06-09 09:16:46 +00:00

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com> Reviewed-by: Fabian Ebner <f.ebner@proxmox.com> Tested-by: Fabian Ebner <f.ebner@proxmox.com>
28 lines
693 B
JavaScript
28 lines
693 B
JavaScript
Ext.define('PVE.controller.StorageEdit', {
|
|
extend: 'Ext.app.ViewController',
|
|
alias: 'controller.storageEdit',
|
|
control: {
|
|
'field[name=content]': {
|
|
change: function(field, value) {
|
|
const hasImages = Ext.Array.contains(value, 'images');
|
|
const prealloc = field.up('form').getForm().findField('preallocation');
|
|
if (prealloc) {
|
|
prealloc.setDisabled(!hasImages);
|
|
}
|
|
|
|
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);
|
|
},
|
|
},
|
|
},
|
|
});
|