mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-09 04:51:09 +00:00
fix 3850: ui: storage: using PreallocationSelector for file based storage types
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>
This commit is contained in:
parent
418e9c13ae
commit
bb157f5d6d
@ -4,6 +4,12 @@ Ext.define('PVE.controller.StorageEdit', {
|
|||||||
control: {
|
control: {
|
||||||
'field[name=content]': {
|
'field[name=content]': {
|
||||||
change: function(field, value) {
|
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 hasBackups = Ext.Array.contains(value, 'backup');
|
||||||
var maxfiles = this.lookupReference('maxfiles');
|
var maxfiles = this.lookupReference('maxfiles');
|
||||||
if (!maxfiles) {
|
if (!maxfiles) {
|
||||||
|
@ -51,6 +51,26 @@ Ext.define('PVE.panel.StorageBase', {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const qemuImgStorageTypes = ['dir', 'btrfs', 'nfs', 'cifs', 'glusterfs'];
|
||||||
|
|
||||||
|
if (qemuImgStorageTypes.includes(me.type)) {
|
||||||
|
const preallocSelector = {
|
||||||
|
xtype: 'pvePreallocationSelector',
|
||||||
|
name: 'preallocation',
|
||||||
|
fieldLabel: gettext('Preallocation'),
|
||||||
|
allowBlank: false,
|
||||||
|
value: '__default__',
|
||||||
|
};
|
||||||
|
|
||||||
|
me.advancedColumn1 = me.advancedColumn1 || [];
|
||||||
|
me.advancedColumn2 = me.advancedColumn2 || [];
|
||||||
|
if (me.advancedColumn2.length < me.advancedColumn1.length) {
|
||||||
|
me.advancedColumn2.unshift(preallocSelector);
|
||||||
|
} else {
|
||||||
|
me.advancedColumn1.unshift(preallocSelector);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -143,7 +143,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
me.advancedColumn1 = [
|
me.advancedColumn2 = [
|
||||||
{
|
{
|
||||||
xtype: 'proxmoxKVComboBox',
|
xtype: 'proxmoxKVComboBox',
|
||||||
fieldLabel: gettext('NFS Version'),
|
fieldLabel: gettext('NFS Version'),
|
||||||
|
Loading…
Reference in New Issue
Block a user