From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 154569B100 for ; Mon, 20 Nov 2023 08:23:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E008014936 for ; Mon, 20 Nov 2023 08:23:02 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 20 Nov 2023 08:23:02 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 1C0E3432F0 for ; Mon, 20 Nov 2023 08:23:02 +0100 (CET) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pve-devel@lists.proxmox.com Date: Mon, 20 Nov 2023 08:22:42 +0100 Message-Id: <20231120072242.75599-5-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231120072242.75599-1-f.gruenbichler@proxmox.com> References: <20231120072242.75599-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.065 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH manager 2/2] ui: pools: switch to new API endpoints X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2023 07:23:33 -0000 which support nested pools. mostly straight-forward, only pool deletion and the members grid need some special attention. Signed-off-by: Fabian Grünbichler --- Notes: Thanks Dominik for pointing me at the 'root' part of the proxy :) www/manager6/dc/PoolView.js | 3 +++ www/manager6/grid/PoolMembers.js | 14 ++++++++------ www/manager6/pool/StatusView.js | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/www/manager6/dc/PoolView.js b/www/manager6/dc/PoolView.js index db97cbe72..741b2025b 100644 --- a/www/manager6/dc/PoolView.js +++ b/www/manager6/dc/PoolView.js @@ -31,6 +31,9 @@ Ext.define('PVE.dc.PoolView', { callback: function() { reload(); }, + getUrl: function(rec) { + return '/pools/?poolid=' + rec.getId(); + }, }); var run_editor = function() { diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMembers.js index 74950d80e..75f20cab1 100644 --- a/www/manager6/grid/PoolMembers.js +++ b/www/manager6/grid/PoolMembers.js @@ -17,8 +17,9 @@ Ext.define('PVE.pool.AddVM', { throw "no pool specified"; } - me.url = "/pools/" + me.pool; + me.url = '/pools/'; me.method = 'PUT'; + me.extraRequestParams.poolid = me.pool; var vmsField = Ext.create('Ext.form.field.Text', { name: 'vms', @@ -120,8 +121,9 @@ Ext.define('PVE.pool.AddStorage', { me.isCreate = true; me.isAdd = true; - me.url = "/pools/" + me.pool; + me.url = "/pools/"; me.method = 'PUT'; + me.extraRequestParams.poolid = me.pool; Ext.apply(me, { subject: gettext('Storage'), @@ -168,8 +170,8 @@ Ext.define('PVE.grid.PoolMembers', { ], proxy: { type: 'proxmox', - root: 'data.members', - url: "/api2/json/pools/" + me.pool, + root: 'data[0].members', + url: "/api2/json/pools/?poolid=" + me.pool, }, }); @@ -192,7 +194,7 @@ Ext.define('PVE.grid.PoolMembers', { "'" + rec.data.id + "'"); }, handler: function(btn, event, rec) { - var params = { 'delete': 1 }; + var params = { 'delete': 1, poolid: me.pool }; if (rec.data.type === 'storage') { params.storage = rec.data.storage; } else if (rec.data.type === 'qemu' || rec.data.type === 'lxc' || rec.data.type === 'openvz') { @@ -202,7 +204,7 @@ Ext.define('PVE.grid.PoolMembers', { } Proxmox.Utils.API2Request({ - url: '/pools/' + me.pool, + url: '/pools/', method: 'PUT', params: params, waitMsgTarget: me, diff --git a/www/manager6/pool/StatusView.js b/www/manager6/pool/StatusView.js index 302ae5ab0..3d46b3b1a 100644 --- a/www/manager6/pool/StatusView.js +++ b/www/manager6/pool/StatusView.js @@ -24,7 +24,7 @@ Ext.define('PVE.pool.StatusView', { }; Ext.apply(me, { - url: "/api2/json/pools/" + pool, + url: "/api2/json/pools/?poolid=" + pool, rows: rows, }); -- 2.39.2