public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, Stefan Hrdlicka <s.hrdlicka@proxmox.com>
Subject: Re: [pve-devel] [PATCH V2 manager 1/3] fix #2822: add iscsi, lvm, lvmthin & zfs storage for all cluster nodes
Date: Tue, 28 Jun 2022 12:33:51 +0200	[thread overview]
Message-ID: <2cd2d083-e312-fd54-e77d-782bce413192@proxmox.com> (raw)
In-Reply-To: <20220622143929.2757681-2-s.hrdlicka@proxmox.com>

Am 22.06.22 um 16:39 schrieb Stefan Hrdlicka:
> 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.

I don't think we should change the default restriction, especially for
iSCSI and (shared) LVM, but also for local ones, as in many cases,
cluster nodes will be set-up with similar storage and the new default
might trip up some people.

> 
> Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
> ---
>  www/manager6/storage/Base.js        | 44 ++++++++++++++++++++++-
>  www/manager6/storage/IScsiEdit.js   | 54 ++++++++++++++++++++++-------
>  www/manager6/storage/LVMEdit.js     | 21 +++++++++--
>  www/manager6/storage/LvmThinEdit.js | 35 ++++++++++++++-----
>  www/manager6/storage/ZFSPoolEdit.js | 24 ++++++++++---
>  5 files changed, 148 insertions(+), 30 deletions(-)
> 
> diff --git a/www/manager6/storage/Base.js b/www/manager6/storage/Base.js
> index 7f6d7a09..bb497a5f 100644
> --- a/www/manager6/storage/Base.js
> +++ b/www/manager6/storage/Base.js
> @@ -34,8 +34,9 @@ Ext.define('PVE.panel.StorageBase', {
>  	me.column2 = me.column2 || [];
>  	me.column2.unshift(
>  	    {
> -		xtype: 'pveNodeSelector',
> +		xtype: 'pveScanNodeSelector',

This class/type alias is never defined? And why change the restriction
selector to a scan selector?

>  		name: 'nodes',
> +		reference: 'storageNodeRestriction',
>  		disabled: me.storageId === 'local',
>  		fieldLabel: gettext('Nodes'),
>  		emptyText: gettext('All') + ' (' + gettext('No restrictions') +')',
> @@ -74,6 +75,47 @@ Ext.define('PVE.panel.StorageBase', {
>  
>  	me.callParent();
>      },
> +    getPveScanNodeSelector: function() {

No need for this function. The properties can be set as part of the
class definition and overriden by the specific instances as needed.

> +	return {
> +	    xtype: 'pveScanNodeSelector',
> +	    name: 'node',
> +	    itemId: 'pveScanNodeSelector',
> +	    fieldLabel: gettext('Scan node'),
> +	    allowBlank: false,
> +	    disallowedNodes: undefined,
> +	    onlineValidator: true,
> +	    preferredValue: Proxmox.NodeName,
> +	    submitValue: false,
> +	    autoEl: {
> +		tag: 'div',
> +		'data-qtip': gettext('Look for availabe storage options from selected node.'),

"Look" and "from" sound a bit strange to me (also typo in "availabe").
Maybe "Scan for available storages on (the) selected node"?

> +	    },
> +	};
> +    },
> +});
> +
> +Ext.define('PVE.storage.ComboBoxSetStoreNode', {
> +    extend: 'Ext.form.field.ComboBox',
> +    config: {
> +	apiBaseUrl: '/api2/json/nodes/',
> +	apiStoragePath: '',
> +    },
> +
> +    setNodeName: function(value, storeLoad = true) {
> +	let me = this;
> +	if (value === null || value === '') {
> +	    value = Proxmox.NodeName;
> +	}
> +
> +	let store = me.getStore();
> +	let proxy = store.getProxy();
> +	proxy.setUrl(me.apiBaseUrl + value + me.apiStoragePath);
> +	this.clearValue();
> +	if (storeLoad) {
> +	    store.load();
> +	}
> +    },
> +
>  });
>  
>  Ext.define('PVE.storage.BaseEdit', {

(...)

> @@ -140,6 +145,20 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
>  		    },
>  		},
>  	    });
> +	    let pveScanNodeSelector = me.getPveScanNodeSelector();
> +	    pveScanNodeSelector.listeners = {
> +	        change: {
> +		    fn: function(field, value) {
> +			// don't reload the store, it requires a VG selected
> +			vgField.setNodeName(value, false);

I'd rather drop the additional parameter from setNodeName and override
it for this class. The class itself knows best when it can load and the
'vg' property should be reset as part of the setNodeName implementation.

> +			vgSelector.setNodeName(value);
> +			me.lookupReference('storageNodeRestriction').setValue(value);
> +		    },
> +	        },
> +	    };
> +	    me.column1.push(pveScanNodeSelector);
> +
> +	    me.column1.push(vgSelector);
>  
>  	    me.column1.push(vgField);
>  	}




  reply	other threads:[~2022-06-28 10:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 14:39 [pve-devel] [PATCH V2 manager 0/3] add iscsi, lvm, lvmthin & zfs storage on " Stefan Hrdlicka
2022-06-22 14:39 ` [pve-devel] [PATCH V2 manager 1/3] fix #2822: add iscsi, lvm, lvmthin & zfs storage for " Stefan Hrdlicka
2022-06-28 10:33   ` Fabian Ebner [this message]
     [not found]     ` <779a3434-e2a9-c92a-56b1-625346dcf1d4@proxmox.com>
2022-07-19  6:50       ` Fabian Ebner
2022-06-22 14:39 ` [pve-devel] [PATCH V2 manager 2/3] cleanup: "var" to "let", fix some indentation in related files Stefan Hrdlicka
2022-06-28 10:54   ` Fabian Ebner
2022-06-28 13:10     ` Thomas Lamprecht
2022-06-22 14:39 ` [pve-devel] [PATCH V2 manager 3/3] cleanup: "var" to "let" in all javascript files Stefan Hrdlicka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cd2d083-e312-fd54-e77d-782bce413192@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.hrdlicka@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal