public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Hannes Laimer <h.laimer@proxmox.com>, pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-backup v5 7/9] ui: add move group action
Date: Tue, 24 Mar 2026 11:41:34 +0100	[thread overview]
Message-ID: <2d359aed-cac8-4597-a696-5d1d3cd90f52@proxmox.com> (raw)
In-Reply-To: <20260319161325.206846-8-h.laimer@proxmox.com>

code looks good to me, but please add more information in the commit 
message.

On 3/19/26 5:13 PM, Hannes Laimer wrote:
> 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 9ebf0445..7745d9f4 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 981acdc7..b56cc4ac 100644
> --- a/www/datastore/Content.js
> +++ b/www/datastore/Content.js
> @@ -667,6 +667,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();
> @@ -971,6 +992,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') {
> @@ -1085,6 +1107,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 }) =>
> @@ -1437,6 +1473,7 @@ Ext.define('PBS.datastore.GroupCmdMenu', {
>       onVerify: undefined,
>       onChangeOwner: undefined,
>       onPrune: undefined,
> +    onMove: undefined,
>       onForget: undefined,
>   
>       items: [
> @@ -1460,6 +1497,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..f663c606
> --- /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-namespaces',
> +
> +    isCreate: true,
> +    submitText: gettext('Move'),
> +    showTaskViewer: true,
> +
> +    cbind: {
> +        url: '/api2/extjs/admin/datastore/{datastore}/groups',
> +        title: (get) => Ext.String.format(gettext("Move Backup Group '{0}'"), get('group')),
> +    },
> +    method: 'PUT',
> +
> +    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,
> +                'new-ns': values['new-ns'] || '',
> +            };
> +            if (win.namespace && win.namespace !== '') {
> +                result.ns = win.namespace;
> +            }
> +            return result;
> +        },
> +        items: [
> +            {
> +                xtype: 'displayfield',
> +                fieldLabel: gettext('Group'),
> +                cbind: {
> +                    value: '{group}',
> +                },
> +            },
> +            {
> +                xtype: 'pbsNamespaceSelector',
> +                name: 'new-ns',
> +                fieldLabel: gettext('Target Namespace'),
> +                allowBlank: true,
> +                cbind: {
> +                    datastore: '{datastore}',
> +                },
> +            },
> +        ],
> +    },
> +});





  reply	other threads:[~2026-03-24 10:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 16:13 [PATCH proxmox-backup v5 0/9] fixes #6195: add support for moving groups and namespaces Hannes Laimer
2026-03-19 16:13 ` [PATCH proxmox-backup v5 1/9] ui: show empty groups Hannes Laimer
2026-03-24 10:28   ` Dominik Csapak
2026-03-19 16:13 ` [PATCH proxmox-backup v5 2/9] datastore: add namespace-level locking Hannes Laimer
2026-03-24 13:00   ` Fabian Grünbichler
2026-03-19 16:13 ` [PATCH proxmox-backup v5 3/9] datastore: add move_group Hannes Laimer
2026-03-24 13:00   ` Fabian Grünbichler
2026-03-25  6:20     ` Hannes Laimer
2026-03-19 16:13 ` [PATCH proxmox-backup v5 4/9] datastore: add move_namespace Hannes Laimer
2026-03-24 13:00   ` Fabian Grünbichler
2026-03-25  6:32     ` Hannes Laimer
2026-03-25  8:55       ` Fabian Grünbichler
2026-03-19 16:13 ` [PATCH proxmox-backup v5 5/9] api: add PUT endpoint for move_group Hannes Laimer
2026-03-19 16:13 ` [PATCH proxmox-backup v5 6/9] api: add PUT endpoint for move_namespace Hannes Laimer
2026-03-19 16:13 ` [PATCH proxmox-backup v5 7/9] ui: add move group action Hannes Laimer
2026-03-24 10:41   ` Dominik Csapak [this message]
2026-03-19 16:13 ` [PATCH proxmox-backup v5 8/9] ui: add move namespace action Hannes Laimer
2026-03-24 10:56   ` Dominik Csapak
2026-03-19 16:13 ` [PATCH proxmox-backup v5 9/9] cli: add move-namespace and move-group commands Hannes Laimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d359aed-cac8-4597-a696-5d1d3cd90f52@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=h.laimer@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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