public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 manager] ui: RBDStorage: add field for RBD namespace
@ 2021-04-19  7:52 Aaron Lauterer
  2021-04-26 18:17 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lauterer @ 2021-04-19  7:52 UTC (permalink / raw)
  To: pve-devel

Makes it possible to configure the RBD namespace via the GUI.

RBD namespaces must be configured manually. The most likely use case is
when connecting to an external Ceph cluster as this makes it possible to
separate client PVE clusters by namespace, not by pool.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
changes from v1: code improvements / cleanup as suggested by thomas

the warning can be removed once we have a check for the existence of the
namespace in place [0]

[0] https://lists.proxmox.com/pipermail/pve-devel/2021-April/047653.html

 www/manager6/storage/RBDEdit.js | 55 +++++++++++++++++++++++++--------
 1 file changed, 42 insertions(+), 13 deletions(-)

diff --git a/www/manager6/storage/RBDEdit.js b/www/manager6/storage/RBDEdit.js
index be29dc8a..c55a05c0 100644
--- a/www/manager6/storage/RBDEdit.js
+++ b/www/manager6/storage/RBDEdit.js
@@ -5,6 +5,7 @@ Ext.define('PVE.storage.Ceph.Model', {
     data: {
 	pveceph: true,
 	pvecephPossible: true,
+	namespacePresent: false,
     },
 });
 
@@ -26,10 +27,16 @@ Ext.define('PVE.storage.Ceph.Controller', {
 	    disable: 'resetField',
 	    enable: 'resetField',
 	},
+	'textfield[name=namespace]': {
+	    change: 'updateNamespaceHint',
+	},
     },
     resetField: function(field) {
 	field.reset();
     },
+    updateNamespaceHint: function(field, newVal, oldVal) {
+	this.getViewModel().set('namespacePresent', newVal);
+    },
     queryMonitors: function(field, newVal, oldVal) {
 	// we get called with two signatures, the above one for a field
 	// change event and the afterrender from the view, this check only
@@ -88,6 +95,9 @@ Ext.define('PVE.storage.RBDInputPanel', {
 	    this.lookupReference('pvecephRef').setValue(false);
 	    this.lookupReference('pvecephRef').resetOriginalValue();
 	}
+	if (values.namespace) {
+	    this.getViewModel().set('namespacePresent', true);
+	}
 	this.callParent([values]);
     },
 
@@ -170,6 +180,14 @@ Ext.define('PVE.storage.RBDInputPanel', {
 		fieldLabel: gettext('User name'),
 		allowBlank: true,
 	    },
+	    {
+		xtype: 'pmxDisplayEditField',
+		editable: me.isCreate,
+		name: 'namespace',
+		value: '',
+		fieldLabel: gettext('Namespace'),
+		allowBlank: true,
+	    },
 	);
 
 	me.column2 = [
@@ -190,20 +208,31 @@ Ext.define('PVE.storage.RBDInputPanel', {
 	    },
 	];
 
-	me.columnB = [{
-	    xtype: 'proxmoxcheckbox',
-	    name: 'pveceph',
-	    reference: 'pvecephRef',
-	    bind: {
-		disabled: '{!pvecephPossible}',
-		value: '{pveceph}',
+	me.columnB = [
+	    {
+		xtype: 'proxmoxcheckbox',
+		name: 'pveceph',
+		reference: 'pvecephRef',
+		bind: {
+		    disabled: '{!pvecephPossible}',
+		    value: '{pveceph}',
+		},
+		checked: true,
+		uncheckedValue: 0,
+		submitValue: false,
+		hidden: !me.isCreate,
+		boxLabel: gettext('Use Proxmox VE managed hyper-converged ceph pool'),
 	    },
-	    checked: true,
-	    uncheckedValue: 0,
-	    submitValue: false,
-	    hidden: !me.isCreate,
-	    boxLabel: gettext('Use Proxmox VE managed hyper-converged ceph pool'),
-	}];
+	    {
+		xtype: 'displayfield',
+		name: 'namespace-hint',
+		userCls: 'pmx-hint',
+		value: gettext('RBD namespaces must be created manually!'),
+		bind: {
+		    hidden: '{!namespacePresent}',
+		},
+	    },
+	];
 
 	me.callParent();
     },
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH v2 manager] ui: RBDStorage: add field for RBD namespace
  2021-04-19  7:52 [pve-devel] [PATCH v2 manager] ui: RBDStorage: add field for RBD namespace Aaron Lauterer
@ 2021-04-26 18:17 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-04-26 18:17 UTC (permalink / raw)
  To: Proxmox VE development discussion, Aaron Lauterer

On 19.04.21 09:52, Aaron Lauterer wrote:
> Makes it possible to configure the RBD namespace via the GUI.
> 
> RBD namespaces must be configured manually. The most likely use case is
> when connecting to an external Ceph cluster as this makes it possible to
> separate client PVE clusters by namespace, not by pool.
> 
> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
> ---
> changes from v1: code improvements / cleanup as suggested by thomas
> 
> the warning can be removed once we have a check for the existence of the
> namespace in place [0]
> 
> [0] https://lists.proxmox.com/pipermail/pve-devel/2021-April/047653.html
> 
>  www/manager6/storage/RBDEdit.js | 55 +++++++++++++++++++++++++--------
>  1 file changed, 42 insertions(+), 13 deletions(-)
> 
>

applied, but I moved those fields in the advanced section - thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-26 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19  7:52 [pve-devel] [PATCH v2 manager] ui: RBDStorage: add field for RBD namespace Aaron Lauterer
2021-04-26 18:17 ` [pve-devel] applied: " Thomas Lamprecht

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