Namely, if there is a storage in the backup configuration that's not
available on the current node.

Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---

New in v2.

 www/manager6/window/Restore.js | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/www/manager6/window/Restore.js b/www/manager6/window/Restore.js
index e7b3e945..25babf89 100644
--- a/www/manager6/window/Restore.js
+++ b/www/manager6/window/Restore.js
@@ -15,6 +15,40 @@ Ext.define('PVE.window.Restore', {
                },
            },
        },
+
+       afterRender: function() {
+           let view = this.getView();
+
+           Proxmox.Utils.API2Request({
+               url: `/nodes/${view.nodename}/vzdump/extractconfig`,
+               method: 'GET',
+               params: {
+                   volume: view.volid,
+               },
+               failure: (response) => Ext.Msg.alert('Error', 
response.htmlStatus),
+               success: function(response, options) {
+                   let storagesAvailable = true;
+
+                   response.result.data.split('\n').forEach(function(line) {
+                       let match = line.match(
+                           /^#qmdump#map:(\S+):(\S+):(\S*):(\S*):$/,
+                       );
+                       if (match) {
+                           let currentAvailable = 
!!PVE.data.ResourceStore.getById(
+                               `storage/${view.nodename}/${match[3]}`,
+                           );
+                           storagesAvailable = storagesAvailable && 
currentAvailable;
+                       }
+                   });
+
+                   if (!storagesAvailable) {
+                       let storagesel = 
view.down('pveStorageSelector[name=storage]');
+                       storagesel.allowBlank = false;
+                       storagesel.setEmptyText('');
+                   }
+               },
+           });
+       },
     },
 
     initComponent: function() {
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to