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 v3 4/5] ui: tape/ChangerStatus: adding parameter selection to inventory
Date: Wed, 19 Oct 2022 13:13:34 +0200	[thread overview]
Message-ID: <20221019111335.872853-5-d.csapak@proxmox.com> (raw)
In-Reply-To: <20221019111335.872853-1-d.csapak@proxmox.com>

namely 'catalog' and 'read-all-labels', by always opening a
window (with a drive now autoselected) and the two checkboxes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/tape/ChangerStatus.js | 66 ++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 36 deletions(-)

diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
index a99b6ba6..27c7605c 100644
--- a/www/tape/ChangerStatus.js
+++ b/www/tape/ChangerStatus.js
@@ -375,46 +375,40 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 		return;
 	    }
 
-	    let singleDrive = me.drives.length === 1 ? me.drives[0] : undefined;
+	    Ext.create('Proxmox.window.Edit', {
+		title: gettext('Inventory'),
+		showTaskViewer: true,
+		method: 'PUT',
+		url: '/api2/extjs/tape/drive',
+		submitUrl: function(url, values) {
+		    let drive = values.drive;
+		    delete values.drive;
+		    return `${url}/${encodeURIComponent(drive)}/inventory`;
+		},
 
-	    if (singleDrive !== undefined) {
-		Proxmox.Utils.API2Request({
-		    method: 'PUT',
-		    url: `/api2/extjs/tape/drive/${singleDrive}/inventory`,
-		    success: function(response, opt) {
-			Ext.create('Proxmox.window.TaskViewer', {
-			    upid: response.result.data,
-			    taskDone: function(success) {
-				me.reload();
-			    },
-			}).show();
+		items: [
+		    {
+			xtype: 'pbsDriveSelector',
+			labelWidth: 120,
+			fieldLabel: gettext('Drive'),
+			name: 'drive',
+			changer: changer,
+			autoSelect: true,
 		    },
-		    failure: function(response, opt) {
-			Ext.Msg.alert(gettext('Error'), response.htmlStatus);
+		    {
+			xtype: 'proxmoxcheckbox',
+			labelWidth: 120,
+			fieldLabel: gettext('Restore Catalogs'),
+			name: 'catalog',
 		    },
-		});
-	    } else {
-		Ext.create('Proxmox.window.Edit', {
-		    title: gettext('Inventory'),
-		    showTaskViewer: true,
-		    method: 'PUT',
-		    url: '/api2/extjs/tape/drive',
-		    submitUrl: function(url, values) {
-			let drive = values.drive;
-			delete values.drive;
-			return `${url}/${encodeURIComponent(drive)}/inventory`;
+		    {
+			xtype: 'proxmoxcheckbox',
+			labelWidth: 120,
+			fieldLabel: gettext('Force all Tapes'),
+			name: 'read-all-labels',
 		    },
-
-		    items: [
-			{
-			    xtype: 'pbsDriveSelector',
-			    fieldLabel: gettext('Drive'),
-			    name: 'drive',
-			    changer: changer,
-			},
-		    ],
-		}).show();
-	    }
+		],
+	    }).show();
 	},
 
 	scheduleReload: function(time) {
-- 
2.30.2





  parent reply	other threads:[~2022-10-19 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 11:13 [pbs-devel] [PATCH proxmox-backup v3 0/5] allow restoring catalogs during inventory Dominik Csapak
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 1/5] tape: replace '&Path' with 'AsRef<Path>' in function parameters Dominik Csapak
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 2/5] api/tape/inventory: optionally try to restore catalogs Dominik Csapak
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 3/5] proxmox-tape: add 'catalog' option to 'proxmox-tape inventory' Dominik Csapak
2022-10-19 11:13 ` Dominik Csapak [this message]
2022-10-19 11:13 ` [pbs-devel] [PATCH proxmox-backup v3 5/5] proxmox-tape: inventory: add default to parameters Dominik Csapak
2022-10-20 11:24 ` [pbs-devel] applied-series: [PATCH proxmox-backup v3 0/5] allow restoring catalogs during inventory Wolfgang Bumiller

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=20221019111335.872853-5-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