public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] ui: pool view: fix editing nested pools
@ 2023-11-23 10:07 Dominik Csapak
  2023-11-23 10:37 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-11-23 10:07 UTC (permalink / raw)
  To: pve-devel

for nested pools we have to provide the pool id via a get parameter
instead of in the path, and also we have to extract the data from the
returned array.

To do this, changet the cbind url handler, remove the autoLoad one,
and handle the load ourselves.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/dc/PoolEdit.js | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/www/manager6/dc/PoolEdit.js b/www/manager6/dc/PoolEdit.js
index d55756e7..db3d23cd 100644
--- a/www/manager6/dc/PoolEdit.js
+++ b/www/manager6/dc/PoolEdit.js
@@ -11,8 +11,7 @@ Ext.define('PVE.dc.PoolEdit', {
     },
 
     cbind: {
-	autoLoad: get => !get('isCreate'),
-	url: get => `/api2/extjs/pools/${get('poolid')}`,
+	url: get => `/api2/extjs/pools/${!get('isCreate') ? '?poolid=' + get('poolid') : ''}`,
 	method: get => get('isCreate') ? 'POST' : 'PUT',
     },
 
@@ -34,4 +33,21 @@ Ext.define('PVE.dc.PoolEdit', {
 	    allowBlank: true,
 	},
     ],
+
+    initComponent: function() {
+	let me = this;
+	me.callParent();
+	if (me.poolid) {
+	    me.load({
+		success: function(response) {
+		    let data = response.result.data;
+		    if (Ext.isArray(data)) {
+			me.setValues(data[0]);
+		    } else {
+			me.setValues(data);
+		    }
+		},
+	    });
+	}
+    },
 });
-- 
2.30.2





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

* [pve-devel] applied: [PATCH manager] ui: pool view: fix editing nested pools
  2023-11-23 10:07 [pve-devel] [PATCH manager] ui: pool view: fix editing nested pools Dominik Csapak
@ 2023-11-23 10:37 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-11-23 10:37 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 23/11/2023 um 11:07 schrieb Dominik Csapak:
> for nested pools we have to provide the pool id via a get parameter
> instead of in the path, and also we have to extract the data from the
> returned array.
> 
> To do this, changet the cbind url handler, remove the autoLoad one,
> and handle the load ourselves.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/manager6/dc/PoolEdit.js | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
>

applied, thanks!




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

end of thread, other threads:[~2023-11-23 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23 10:07 [pve-devel] [PATCH manager] ui: pool view: fix editing nested pools Dominik Csapak
2023-11-23 10:37 ` [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