mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-24 13:49:30 +00:00

by converting the relevant selection boxes to combogrids. This is done to reduce confusion for how/why to select a node, and doing it this way it is moved closer to the selection of the actual value we want. It still restricts the nodes when selecting a specific one. Show it only when there is more than one node according to the in-memory PVE.data.ResourceStore info, as for single-node setups there isn't any other node one could scan anyway. Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
119 lines
2.2 KiB
JavaScript
119 lines
2.2 KiB
JavaScript
Ext.define('PVE.storage.ZFSPoolSelector', {
|
|
extend: 'PVE.form.ComboBoxSetStoreNode',
|
|
alias: 'widget.pveZFSPoolSelector',
|
|
valueField: 'pool',
|
|
displayField: 'pool',
|
|
queryMode: 'local',
|
|
editable: false,
|
|
allowBlank: false,
|
|
|
|
listConfig: {
|
|
columns: [
|
|
{
|
|
dataIndex: 'pool',
|
|
flex: 1,
|
|
},
|
|
],
|
|
emptyText: gettext('No ZFS Pools found'),
|
|
},
|
|
|
|
config: {
|
|
apiSuffix: '/scan/zfs',
|
|
},
|
|
|
|
showNodeSelector: true,
|
|
|
|
setNodeName: function(value) {
|
|
let me = this;
|
|
me.callParent([value]);
|
|
me.getStore().load();
|
|
},
|
|
|
|
initComponent: function() {
|
|
let me = this;
|
|
|
|
if (!me.nodename) {
|
|
me.nodename = 'localhost';
|
|
}
|
|
|
|
let store = Ext.create('Ext.data.Store', {
|
|
autoLoad: {}, // true,
|
|
fields: ['pool', 'size', 'free'],
|
|
proxy: {
|
|
type: 'proxmox',
|
|
url: `${me.apiBaseUrl}${me.nodename}${me.apiSuffix}`,
|
|
},
|
|
});
|
|
store.sort('pool', 'ASC');
|
|
|
|
Ext.apply(me, {
|
|
store: store,
|
|
});
|
|
|
|
me.callParent();
|
|
},
|
|
});
|
|
|
|
Ext.define('PVE.storage.ZFSPoolInputPanel', {
|
|
extend: 'PVE.panel.StorageBase',
|
|
|
|
onlineHelp: 'storage_zfspool',
|
|
|
|
initComponent: function() {
|
|
let me = this;
|
|
|
|
me.column1 = [];
|
|
|
|
if (me.isCreate) {
|
|
me.column1.push(Ext.create('PVE.storage.ZFSPoolSelector', {
|
|
name: 'pool',
|
|
fieldLabel: gettext('ZFS Pool'),
|
|
reference: 'zfsPoolSelector',
|
|
allowBlank: false,
|
|
listeners: {
|
|
nodechanged: function(value) {
|
|
me.lookup('storageNodeRestriction').setValue(value);
|
|
},
|
|
},
|
|
}));
|
|
} else {
|
|
me.column1.push(Ext.createWidget('displayfield', {
|
|
name: 'pool',
|
|
value: '',
|
|
fieldLabel: gettext('ZFS Pool'),
|
|
allowBlank: false,
|
|
}));
|
|
}
|
|
|
|
// value is an array,
|
|
// while before it was a string
|
|
me.column1.push({
|
|
xtype: 'pveContentTypeSelector',
|
|
cts: ['images', 'rootdir'],
|
|
fieldLabel: gettext('Content'),
|
|
name: 'content',
|
|
value: ['images', 'rootdir'],
|
|
multiSelect: true,
|
|
allowBlank: false,
|
|
});
|
|
me.column2 = [
|
|
{
|
|
xtype: 'proxmoxcheckbox',
|
|
name: 'sparse',
|
|
checked: false,
|
|
uncheckedValue: 0,
|
|
fieldLabel: gettext('Thin provision'),
|
|
},
|
|
{
|
|
xtype: 'textfield',
|
|
name: 'blocksize',
|
|
emptyText: '8k',
|
|
fieldLabel: gettext('Block Size'),
|
|
allowBlank: true,
|
|
},
|
|
];
|
|
|
|
me.callParent();
|
|
},
|
|
});
|