From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B67ED1FF15C for <inbox@lore.proxmox.com>; Fri, 4 Apr 2025 15:34:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 66EC731847; Fri, 4 Apr 2025 15:33:13 +0200 (CEST) From: Fiona Ebner <f.ebner@proxmox.com> To: pve-devel@lists.proxmox.com Date: Fri, 4 Apr 2025 15:32:03 +0200 Message-Id: <20250404133204.239783-29-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250404133204.239783-1-f.ebner@proxmox.com> References: <20250404133204.239783-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.037 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 Subject: [pve-devel] [PATCH manager v9 28/29] ui: backup: also check for backup subtype to classify archive X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> In anticipation of future storage plugins that might not have PBS-specific formats or adhere to the vzdump naming scheme for backups. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> --- www/manager6/Utils.js | 10 ++++++---- www/manager6/grid/BackupView.js | 4 ++-- www/manager6/storage/BackupView.js | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index aa415759..1ed3de5d 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -694,12 +694,14 @@ Ext.define('PVE.Utils', { 'import': gettext('Import'), }, - volume_is_qemu_backup: function(volid, format) { - return format === 'pbs-vm' || volid.match(':backup/vzdump-qemu-'); + volume_is_qemu_backup: function(volume) { + return volume.format === 'pbs-vm' || volume.volid.match(':backup/vzdump-qemu-') || + volume.subtype === 'qemu'; }, - volume_is_lxc_backup: function(volid, format) { - return format === 'pbs-ct' || volid.match(':backup/vzdump-(lxc|openvz)-'); + volume_is_lxc_backup: function(volume) { + return volume.format === 'pbs-ct' || volume.volid.match(':backup/vzdump-(lxc|openvz)-') || + volume.subtype === 'lxc'; }, authSchema: { diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/BackupView.js index e71d1c88..ef3649c6 100644 --- a/www/manager6/grid/BackupView.js +++ b/www/manager6/grid/BackupView.js @@ -29,11 +29,11 @@ Ext.define('PVE.grid.BackupView', { var vmtypeFilter; if (vmtype === 'lxc' || vmtype === 'openvz') { vmtypeFilter = function(item) { - return PVE.Utils.volume_is_lxc_backup(item.data.volid, item.data.format); + return PVE.Utils.volume_is_lxc_backup(item.data); }; } else if (vmtype === 'qemu') { vmtypeFilter = function(item) { - return PVE.Utils.volume_is_qemu_backup(item.data.volid, item.data.format); + return PVE.Utils.volume_is_qemu_backup(item.data); }; } else { throw "unsupported VM type '" + vmtype + "'"; diff --git a/www/manager6/storage/BackupView.js b/www/manager6/storage/BackupView.js index db184def..749c2136 100644 --- a/www/manager6/storage/BackupView.js +++ b/www/manager6/storage/BackupView.js @@ -86,9 +86,9 @@ Ext.define('PVE.storage.BackupView', { disabled: true, handler: function(b, e, rec) { let vmtype; - if (PVE.Utils.volume_is_qemu_backup(rec.data.volid, rec.data.format)) { + if (PVE.Utils.volume_is_qemu_backup(rec.data)) { vmtype = 'qemu'; - } else if (PVE.Utils.volume_is_lxc_backup(rec.data.volid, rec.data.format)) { + } else if (PVE.Utils.volume_is_lxc_backup(rec.data)) { vmtype = 'lxc'; } else { return; -- 2.39.5 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel