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] ui: tape: prevent mislabeling tapes in changers
Date: Mon, 17 Apr 2023 13:00:43 +0200	[thread overview]
Message-ID: <20230417110043.2729692-1-d.csapak@proxmox.com> (raw)

when labeling a tape in a changer, we pre-fill the label field with
the one from the barcode (if it exists). Letting the user change
the label here does not make much sense, since we assume that they are
the same (e.g. for move operations etc.)

So instead simply display the label to protect users from accidentally
changing it. If a user really needs to have a different label than the
suggested one, it's still possible on the cli.

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

diff --git a/www/tape/window/LabelMedia.js b/www/tape/window/LabelMedia.js
index 21f20dba..e6a3655e 100644
--- a/www/tape/window/LabelMedia.js
+++ b/www/tape/window/LabelMedia.js
@@ -13,6 +13,7 @@ Ext.define('PBS.TapeManagement.LabelMediaWindow', {
     cbindData: function(config) {
 	let me = this;
 	return {
+	    readOnly: !!config.label,
 	    driveid: config.driveid,
 	    label: config.label,
 	};
@@ -50,10 +51,12 @@ Ext.define('PBS.TapeManagement.LabelMediaWindow', {
 	{
 	    fieldLabel: gettext('Label'),
 	    name: 'label-text',
-	    xtype: 'proxmoxtextfield',
+	    xtype: 'pmxDisplayEditField',
+	    submitValue: true,
 	    allowBlank: false,
 	    cbind: {
 		value: '{label}',
+		editable: '{!label}',
 	    },
 	},
 	{
-- 
2.30.2





             reply	other threads:[~2023-04-17 11:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 11:00 Dominik Csapak [this message]
2023-04-17 11:59 ` Dominik Csapak

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=20230417110043.2729692-1-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