mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-10 04:09:00 +00:00
ui: backup: also check for backup subtype to classify archive
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> Tested-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Reviewed-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Link: https://lore.proxmox.com/20250404133204.239783-29-f.ebner@proxmox.com
This commit is contained in:
parent
93cbef3804
commit
3f82460304
@ -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: {
|
||||
|
@ -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 + "'";
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user