mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-24 04:27:33 +00:00

This adds a dropdown box for iSCSI, LVM, LVMThin & ZFS storage options where a cluster node needs to be chosen. As default the current node is selected. It restricts the the storage to be only availabe on the selected node. Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
115 lines
2.3 KiB
JavaScript
115 lines
2.3 KiB
JavaScript
Ext.define('PVE.storage.ZFSPoolSelector', {
|
|
extend: 'PVE.form.ComboBoxSetStoreNode',
|
|
alias: 'widget.pveZFSPoolSelector',
|
|
valueField: 'pool',
|
|
displayField: 'pool',
|
|
queryMode: 'local',
|
|
editable: false,
|
|
listConfig: {
|
|
loadingText: gettext('Scanning...'),
|
|
},
|
|
config: {
|
|
apiSuffix: '/scan/zfs',
|
|
},
|
|
|
|
setNodeName: function(value) {
|
|
let me = this;
|
|
me.callParent([value]);
|
|
me.getStore().load();
|
|
},
|
|
|
|
initComponent: function() {
|
|
var me = this;
|
|
|
|
if (!me.nodename) {
|
|
me.nodename = 'localhost';
|
|
}
|
|
|
|
var 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() {
|
|
var me = this;
|
|
|
|
me.column1 = [];
|
|
|
|
if (me.isCreate) {
|
|
me.column1.push({
|
|
xtype: 'pveStorageScanNodeSelector',
|
|
listeners: {
|
|
change: {
|
|
fn: function(field, value) {
|
|
me.lookup('zfsPoolSelector').setNodeName(value);
|
|
me.lookup('storageNodeRestriction').setValue(value);
|
|
},
|
|
},
|
|
},
|
|
});
|
|
me.column1.push(Ext.create('PVE.storage.ZFSPoolSelector', {
|
|
name: 'pool',
|
|
fieldLabel: gettext('ZFS Pool'),
|
|
reference: 'zfsPoolSelector',
|
|
allowBlank: false,
|
|
}));
|
|
} 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();
|
|
},
|
|
});
|