[PATCH proxmox-backup v7 7/9] ui: add move group action

Hannes Laimer
2026-04-16T17:18:53Z

Add a "Move" action to the backup group context menu and action
column. Opens a dialog where the user selects a target namespace,
then submits a POST to the move-group API endpoint.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
www/Makefile | 1 +
www/datastore/Content.js | 47 +++++++++++++++++++++++++++++++++
www/window/GroupMove.js | 56 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 104 insertions(+)
create mode 100644 www/window/GroupMove.js

diff --git a/www/Makefile b/www/Makefile
index 5a60e47e..06441c02 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -76,6 +76,7 @@ JSSRC= \
config/PruneAndGC.js \
window/ACLEdit.js \
window/BackupGroupChangeOwner.js \
+ window/GroupMove.js \
window/CreateDirectory.js \
window/DataStoreEdit.js \
window/NamespaceEdit.js \
diff --git a/www/datastore/Content.js b/www/datastore/Content.js
index dfb7787c..585a1a2d 100644
--- a/www/datastore/Content.js
+++ b/www/datastore/Content.js
@@ -668,6 +668,27 @@ Ext.define('PBS.DataStoreContent', {
});
},

+ moveGroup: function (data) {
+ let me = this;
+ let view = me.getView();
+ let group = `${data.backup_type}/${data.backup_id}`;
+ Ext.create('PBS.window.GroupMove', {
+ datastore: view.datastore,
+ namespace: view.namespace,
+ backupType: data.backup_type,
+ backupId: data.backup_id,
+ group,
+ taskDone: () => me.reload(),
+ }).show();
+ },
+
+ onMove: function (table, rI, cI, item, e, { data }) {
+ let me = this;
+ if (data.ty === 'group') {
+ me.moveGroup(data);
+ }
+ },
+
forgetGroup: function (data) {
let me = this;
let view = me.getView();
@@ -972,6 +993,7 @@ Ext.define('PBS.DataStoreContent', {
onVerify: createControllerCallback('onVerify'),
onChangeOwner: createControllerCallback('onChangeOwner'),
onPrune: createControllerCallback('onPrune'),
+ onMove: createControllerCallback('onMove'),
onForget: createControllerCallback('onForget'),
});
} else if (record.data.ty === 'dir') {
@@ -1086,6 +1108,20 @@ Ext.define('PBS.DataStoreContent', {
: 'pmx-hidden',
isActionDisabled: (v, r, c, i, rec) => !!rec.data.leaf,
},
+ {
+ handler: 'onMove',
+ getTip: (v, m, { data }) => {
+ if (data.ty === 'group') {
+ return Ext.String.format(gettext("Move group '{0}'"), v);
+ }
+ return '';
+ },
+ getClass: (v, m, { data }) => {
+ if (data.ty === 'group') { return 'fa fa-arrows'; }
+ return 'pmx-hidden';
+ },
+ isActionDisabled: (v, r, c, i, { data }) => false,
+ },
{
handler: 'onChangeOwner',
getClass: (v, m, { data }) =>
@@ -1438,6 +1474,7 @@ Ext.define('PBS.datastore.GroupCmdMenu', {
onVerify: undefined,
onChangeOwner: undefined,
onPrune: undefined,
+ onMove: undefined,
onForget: undefined,

items: [
@@ -1461,6 +1498,16 @@ Ext.define('PBS.datastore.GroupCmdMenu', {
hidden: '{!onVerify}',
},
},
+ {
+ text: gettext('Move'),
+ iconCls: 'fa fa-arrows',
+ handler: function () {
+ this.up('menu').onMove();
+ },
+ cbind: {
+ hidden: '{!onMove}',
+ },
+ },
{
text: gettext('Change owner'),
iconCls: 'fa fa-user',
diff --git a/www/window/GroupMove.js b/www/window/GroupMove.js
new file mode 100644
index 00000000..6bfb0bca
--- /dev/null
+++ b/www/window/GroupMove.js
@@ -0,0 +1,56 @@
+Ext.define('PBS.window.GroupMove', {
+ extend: 'Proxmox.window.Edit',
+ alias: 'widget.pbsGroupMove',
+ mixins: ['Proxmox.Mixin.CBind'],
+
+ onlineHelp: 'storage-move-namespaces-groups',
+
+ isCreate: true,
+ submitText: gettext('Move'),
+ showTaskViewer: true,
+
+ cbind: {
+ url: '/api2/extjs/admin/datastore/{datastore}/move-group',
+ title: (get) => Ext.String.format(gettext("Move Backup Group '{0}'"), get('group')),
+ },
+ method: 'POST',
+
+ width: 400,
+ fieldDefaults: {
+ labelWidth: 120,
+ },
+
+ items: {
+ xtype: 'inputpanel',
+ onGetValues: function (values) {
+ let win = this.up('window');
+ let result = {
+ 'backup-type': win.backupType,
+ 'backup-id': win.backupId,
+ 'target-ns': values['target-ns'] || '',
+ };
+ if (win.namespace && win.namespace !== '') {
+ result.ns = win.namespace;
+ }
+ return result;
+ },
+ items: [
+ {
+ xtype: 'displayfield',
+ fieldLabel: gettext('Group'),
+ cbind: {
+ value: '{group}',
+ },
+ },
+ {
+ xtype: 'pbsNamespaceSelector',
+ name: 'target-ns',
+ fieldLabel: gettext('Target Namespace'),
+ allowBlank: true,
+ cbind: {
+ datastore: '{datastore}',
+ },
+ },
+ ],
+ },
+});
--
2.47.3