From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id A6FDD1FF161 for ; Tue, 13 Aug 2024 15:30:35 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DDD702EF0; Tue, 13 Aug 2024 15:29:16 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Tue, 13 Aug 2024 15:28:28 +0200 Message-Id: <20240813132829.117460-25-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813132829.117460-1-f.ebner@proxmox.com> References: <20240813132829.117460-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.054 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH manager v2 24/25] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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 --- No changes in v2. 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 db86fa9a..a8e4e8ee 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -693,12 +693,14 @@ Ext.define('PVE.Utils', { 'snippets': gettext('Snippets'), }, - 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 878e1c8f..ad6e6a01 100644 --- a/www/manager6/storage/BackupView.js +++ b/www/manager6/storage/BackupView.js @@ -84,9 +84,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.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel