From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 904EB1FF09B for ; Mon, 31 Aug 2026 14:24:48 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 783792126E; Mon, 31 Aug 2026 14:24:47 +0200 (CEST) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v2] ui: datastore content: allow moving namespace from parent Date: Mon, 31 Aug 2026 14:23:44 +0200 Message-ID: <20260831122443.2952899-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.649 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 4ESPOC6NOZBAYY33TQCK6BSS5VXSZXN3 X-Message-ID-Hash: 4ESPOC6NOZBAYY33TQCK6BSS5VXSZXN3 X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: having to go into the namespace to move it seems unintuitive, so allow it from it's parent too. Only navigate to the new place when we were inside the namespace, otherwise we stay at the one we were. Signed-off-by: Dominik Csapak --- changes from v1: * prevent the 'up' entry from getting a move action, by limiting to either ns === undefined (the main namespace entry) or to depth > 1 (namespaces listed under the current one) www/datastore/Content.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/www/datastore/Content.js b/www/datastore/Content.js index bd989e660..117c9ee87 100644 --- a/www/datastore/Content.js +++ b/www/datastore/Content.js @@ -670,17 +670,20 @@ Ext.define('PBS.DataStoreContent', { }); }, - moveNS: function () { + moveNS: function (data) { let me = this; let view = me.getView(); - if (!view.namespace || view.namespace === '') { + + let namespace = data.ns || view.namespace; + if (!namespace) { return; } + let insideNs = !!view.namespace; let win = Ext.create('PBS.window.NamespaceMove', { datastore: view.datastore, - namespace: view.namespace, + namespace, taskDone: (success) => { - if (success) { + if (success && insideNs) { let newNs = win.getNewNamespace(); // update view.namespace and reload the content grid directly rather than // going through the NS selector's change event, which may not fire if the @@ -718,7 +721,7 @@ Ext.define('PBS.DataStoreContent', { if (data.ty === 'group') { me.moveGroup(data); } else if (data.ty === 'ns') { - me.moveNS(); + me.moveNS(data); } }, @@ -1154,7 +1157,11 @@ Ext.define('PBS.DataStoreContent', { if (data.ty === 'group') { return 'fa fa-arrows'; } - if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) { + if ( + data.ty === 'ns' && + !data.isRootNS && + (data.ns === undefined || data.depth > 1) + ) { return 'fa fa-arrows'; } return 'pmx-hidden'; @@ -1163,7 +1170,11 @@ Ext.define('PBS.DataStoreContent', { if (data.ty === 'group') { return false; } - if (data.ty === 'ns' && !data.isRootNS && data.ns === undefined) { + if ( + data.ty === 'ns' && + !data.isRootNS && + (data.ns === undefined || data.depth > 1) + ) { return false; } return true; -- 2.47.3