public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] ui: tape: fix restoring a single datastore
Date: Tue, 25 Apr 2023 15:59:56 +0200	[thread overview]
Message-ID: <20230425135956.83518-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20230425135956.83518-1-d.csapak@proxmox.com>

if the user selected a single datastore to restore from tape on a
media-set that includes more than one, the ui suggests (and is
intended to) that only that datastore will be restored on the selected
target.

The logic to construct the store mapping parameter did not consider that
case, and simply gave the target as default store, which meant all
datastores were restored onto the target.

To fix that, we have to get the source datastore from the field, and
construct the correct parameter ("source=target").

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/tape/window/TapeRestore.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/tape/window/TapeRestore.js b/www/tape/window/TapeRestore.js
index 48119ac6..2ff7c4dd 100644
--- a/www/tape/window/TapeRestore.js
+++ b/www/tape/window/TapeRestore.js
@@ -375,9 +375,15 @@ Ext.define('PBS.TapeManagement.TapeRestoreWindow', {
 		    onGetValues: function(values) {
 			let me = this;
 			let controller = me.up('window').getController();
+			let vm = controller.getViewModel();
 			let datastores = [];
 			if (values.store.toString() !== "") {
-			    datastores.push(values.store);
+			    if (vm.get('singleDatastore')) {
+				let source = controller.lookup('snapshotGrid').getValue();
+				datastores.push(`${source}=${values.store}`);
+			    } else {
+				datastores.push(values.store);
+			    }
 			    delete values.store;
 			}
 
-- 
2.30.2





  reply	other threads:[~2023-04-25 14:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 13:59 [pbs-devel] [PATCH proxmox-backup 1/2] ui: tape: fix formatting Dominik Csapak
2023-04-25 13:59 ` Dominik Csapak [this message]
2023-05-17  9:31   ` [pbs-devel] applied: [PATCH proxmox-backup 2/2] ui: tape: fix restoring a single datastore Thomas Lamprecht
2023-05-17  9:30 ` [pbs-devel] applied: [PATCH proxmox-backup 1/2] ui: tape: fix formatting Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230425135956.83518-2-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal