From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 0290575EE6 for ; Thu, 22 Apr 2021 17:47:49 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ED1271FB84 for ; Thu, 22 Apr 2021 17:47:48 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 532691FB7E for ; Thu, 22 Apr 2021 17:47:48 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2AFC546359 for ; Thu, 22 Apr 2021 17:47:48 +0200 (CEST) From: Stefan Reiter To: pve-devel@lists.proxmox.com Date: Thu, 22 Apr 2021 17:47:38 +0200 Message-Id: <20210422154739.18347-1-s.reiter@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210422153457.12265-1-s.reiter@proxmox.com> References: <20210422153457.12265-1-s.reiter@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.022 Adjusted score from AWL reputation of From: address 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [me.storage] Subject: [pve-devel] [PATCH v2 manager 1/2] backupview: add file restore button 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: , X-List-Received-Date: Thu, 22 Apr 2021 15:47:49 -0000 Adds it for both BackupViews, on VM view and storage view. Signed-off-by: Stefan Reiter --- Forgot to resend this one for v2, it didn't change though AFAIR. www/manager6/grid/BackupView.js | 23 +++++++++++++++++++++++ www/manager6/storage/BackupView.js | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/BackupView.js index b50f52ed..7beeca0e 100644 --- a/www/manager6/grid/BackupView.js +++ b/www/manager6/grid/BackupView.js @@ -228,6 +228,28 @@ Ext.define('PVE.grid.BackupView', { }, }); + let file_restore_btn = Ext.create('Proxmox.button.Button', { + text: gettext('File Restore'), + disabled: true, + selModel: sm, + enableFn: function(rec) { + return !!rec && isPBS; + }, + handler: function(b, e, rec) { + var storage = storagesel.getValue(); + Ext.create('Proxmox.window.FileBrowser', { + title: gettext('File Restore') + " - " + rec.data.text, + listURL: `/api2/json/nodes/localhost/storage/${storage}/file-restore/list`, + downloadURL: `/api2/json/nodes/localhost/storage/${storage}/file-restore/download`, + extraParams: { + snapshot: rec.data.text, + }, + archive: PVE.Utils.volume_is_qemu_backup(rec.data.volid, rec.data.format) ? + 'all' : undefined, + }).show(); + }, + }); + Ext.apply(me, { selModel: sm, tbar: { @@ -238,6 +260,7 @@ Ext.define('PVE.grid.BackupView', { delete_btn, '-', config_btn, + file_restore_btn, '-', { xtype: 'proxmoxButton', diff --git a/www/manager6/storage/BackupView.js b/www/manager6/storage/BackupView.js index 3dd500c2..5be18409 100644 --- a/www/manager6/storage/BackupView.js +++ b/www/manager6/storage/BackupView.js @@ -133,6 +133,25 @@ Ext.define('PVE.storage.BackupView', { renderer: PVE.Utils.render_backup_verification, }, }; + + me.tbar.push({ + xtype: 'proxmoxButton', + text: gettext('File Restore'), + disabled: true, + selModel: sm, + handler: function(b, e, rec) { + Ext.create('Proxmox.window.FileBrowser', { + title: gettext('File Restore') + " - " + rec.data.text, + listURL: `/api2/json/nodes/localhost/storage/${me.storage}/file-restore/list`, + downloadURL: `/api2/json/nodes/localhost/storage/${me.storage}/file-restore/download`, + extraParams: { + snapshot: rec.data.text, + }, + archive: PVE.Utils.volume_is_qemu_backup(rec.data.volid, rec.data.format) ? + 'all' : undefined, + }).show(); + }, + }); } me.callParent(); -- 2.20.1