public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH manager 0/2] ui: dc: backup edit: add filter for guests without backup job
@ 2026-10-01 13:13 Elias Huhsovitz
  2026-10-01 13:13 ` [PATCH manager 1/2] " Elias Huhsovitz
  2026-10-01 13:13 ` [PATCH manager 2/2] ui: dc: backup edit: add missing / to not-backed-up url Elias Huhsovitz
  0 siblings, 2 replies; 3+ messages in thread
From: Elias Huhsovitz @ 2026-10-01 13:13 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

Currently a user has to open the "Show: Guests Without Backup Job"
view, remember the guest and then add/edit a backup job. After
adding/editing the backup job, the user has to again open the "Show:
Guests Without Backup Job" view to verify that no mistake has been
made.

This patch series introduces a convenience filter to the Backup Job
creation and editing window, allowing users to only display guests that
are not covered by any existing backup job.

The filter is available via a new checkbox "Only guests without backup
job", available under  Datacenter > Backup > Add, next to the "Review"
checkbox.

Elias Huhsovitz (2):
  ui: dc: backup edit: add filter for guests without backup job
  ui: dc: backup edit: add missing / to not-backed-up url

 www/manager6/dc/Backup.js | 72 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 67 insertions(+), 5 deletions(-)

-- 
2.47.3





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

* [PATCH manager 1/2] ui: dc: backup edit: add filter for guests without backup job
  2026-10-01 13:13 [PATCH manager 0/2] ui: dc: backup edit: add filter for guests without backup job Elias Huhsovitz
@ 2026-10-01 13:13 ` Elias Huhsovitz
  2026-10-01 13:13 ` [PATCH manager 2/2] ui: dc: backup edit: add missing / to not-backed-up url Elias Huhsovitz
  1 sibling, 0 replies; 3+ messages in thread
From: Elias Huhsovitz @ 2026-10-01 13:13 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

Add a checkbox in the guest selector toolbar that shows only guests
which are not covered by any backup job. The window fetches the guest
list from /cluster/backup-info/not-backed-up once and caches it for the
lifetime of the edit window.

Use a named node filter when the node selector changes instead of
clearing all store filters. This keeps the new filter and the review
filter active across node changes.

Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
 www/manager6/dc/Backup.js | 70 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 66 insertions(+), 4 deletions(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index d3db9d9c..62f1838b 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -66,10 +66,14 @@ Ext.define('PVE.dc.BackupEdit', {
 
             me.resetSearch();
 
-            store.clearFilter();
-            store.filterBy(function (rec) {
-                return !value || rec.get('node') === value;
-            });
+            store.removeFilter('vmgrid-node');
+            if (value) {
+                store.addFilter({
+                    id: 'vmgrid-node',
+                    property: 'node',
+                    value: value,
+                });
+            }
 
             if (value) {
                 let selModel = vmgrid.getSelectionModel();
@@ -246,6 +250,45 @@ Ext.define('PVE.dc.BackupEdit', {
             }
         },
 
+        noBackupJobFilterChange: function (checkbox, checked) {
+            let me = this;
+            let store = me.lookup('vmgrid').getStore();
+
+            if (!checked) {
+                store.removeFilter(me.noJobFilter);
+                return;
+            }
+
+            if (me.noJobVmIds) {
+                store.addFilter(me.noJobFilter);
+                return;
+            }
+
+            checkbox.setDisabled(true);
+            Proxmox.Utils.API2Request({
+                url: '/cluster/backup-info/not-backed-up',
+                method: 'GET',
+                success: function (response) {
+                    let noJobVmIds = {};
+                    let data = response.result.data || [];
+                    for (const rec of data) {
+                        noJobVmIds[String(rec.vmid)] = true;
+                    }
+                    me.noJobVmIds = noJobVmIds;
+
+                    if (checkbox.getValue()) {
+                        store.addFilter(me.noJobFilter);
+                    }
+                    checkbox.setDisabled(false);
+                },
+                failure: function (response) {
+                    Ext.Msg.alert(gettext('Error'), response.htmlStatus);
+                    checkbox.setValue(false);
+                    checkbox.setDisabled(false);
+                },
+            });
+        },
+
         init: function (view) {
             let me = this;
 
@@ -254,6 +297,15 @@ Ext.define('PVE.dc.BackupEdit', {
                 scope: me,
                 filterFn: me.reviewFn,
             });
+
+            me.noJobFilter = new Ext.util.Filter({
+                id: 'vmgrid-no-job',
+                scope: me,
+                filterFn: function (record) {
+                    return me.noJobVmIds && me.noJobVmIds[String(record.get('vmid'))];
+                },
+            });
+
             me.lookup('searchField').setTargetStore(me.lookup('vmgrid').getStore());
 
             if (view.isCreate) {
@@ -463,6 +515,16 @@ Ext.define('PVE.dc.BackupEdit', {
                                     '->',
                                     {
                                         xtype: 'proxmoxcheckbox',
+                                        reference: 'noBackupJobCheckbox',
+                                        boxLabel: gettext('Only guests without backup job'),
+                                        submitValue: false,
+                                        listeners: {
+                                            change: 'noBackupJobFilterChange',
+                                        },
+                                    },
+                                    {
+                                        xtype: 'proxmoxcheckbox',
+                                        reference: 'reviewCheckbox',
                                         boxLabel: gettext('Review'),
                                         submitValue: false,
                                         listeners: {
-- 
2.47.3





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

* [PATCH manager 2/2] ui: dc: backup edit: add missing / to not-backed-up url
  2026-10-01 13:13 [PATCH manager 0/2] ui: dc: backup edit: add filter for guests without backup job Elias Huhsovitz
  2026-10-01 13:13 ` [PATCH manager 1/2] " Elias Huhsovitz
@ 2026-10-01 13:13 ` Elias Huhsovitz
  1 sibling, 0 replies; 3+ messages in thread
From: Elias Huhsovitz @ 2026-10-01 13:13 UTC (permalink / raw)
  To: pve-devel; +Cc: Elias Huhsovitz

Signed-off-by: Elias Huhsovitz <e.huhsovitz@proxmox.com>
---
 www/manager6/dc/Backup.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 62f1838b..3dcef4f7 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -645,7 +645,7 @@ Ext.define(
                 sorters: 'vmid',
                 proxy: {
                     type: 'proxmox',
-                    url: 'api2/json/cluster/backup-info/not-backed-up',
+                    url: '/api2/json/cluster/backup-info/not-backed-up',
                 },
             });
 
-- 
2.47.3





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

end of thread, other threads:[~2026-10-01 13:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 13:13 [PATCH manager 0/2] ui: dc: backup edit: add filter for guests without backup job Elias Huhsovitz
2026-10-01 13:13 ` [PATCH manager 1/2] " Elias Huhsovitz
2026-10-01 13:13 ` [PATCH manager 2/2] ui: dc: backup edit: add missing / to not-backed-up url Elias Huhsovitz

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