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 7E27263268 for ; Tue, 9 Feb 2021 15:41:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6E7F02EE7C for ; Tue, 9 Feb 2021 15:40:46 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 7AC3D2EE72 for ; Tue, 9 Feb 2021 15:40:45 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3C6DF45A44 for ; Tue, 9 Feb 2021 15:40:45 +0100 (CET) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Date: Tue, 9 Feb 2021 15:40:44 +0100 Message-Id: <20210209144044.17782-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210209144044.17782-1-d.csapak@proxmox.com> References: <20210209144044.17782-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.229 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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. [record.data] Subject: [pbs-devel] [PATCH proxmox-backup 3/3] ui: tape/ChangerStatus: show more inventory info for tapes in slots X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 14:41:16 -0000 do not only show if labeled, but the whole status (full/writeable/etc.) and to which pool the tape belongs (if any) Signed-off-by: Dominik Csapak --- www/tape/ChangerStatus.js | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js index 96eeadeb..76677158 100644 --- a/www/tape/ChangerStatus.js +++ b/www/tape/ChangerStatus.js @@ -405,7 +405,11 @@ Ext.define('PBS.TapeManagement.ChangerStatus', { let tapes = {}; for (const tape of tapes_list.result.data) { - tapes[tape['label-text']] = true; + tapes[tape['label-text']] = { + labeled: true, + pool: tape.pool, + status: tape.expired ? 'expired' : tape.status, + }; } let drive_entries = {}; @@ -421,7 +425,13 @@ Ext.define('PBS.TapeManagement.ChangerStatus', { entry = Ext.applyIf(entry, drive_entries[entry['entry-id']]); } - entry['is-labeled'] = !!tapes[entry['label-text']]; + if (tapes[entry['label-text']] !== undefined) { + entry['is-labeled'] = true; + entry.pool = tapes[entry['label-text']].pool; + entry.status = tapes[entry['label-text']].status; + } else { + entry['is-labeled'] = false; + } data[type].push(entry); } @@ -516,9 +526,9 @@ Ext.define('PBS.TapeManagement.ChangerStatus', { renderer: (value) => value || '', }, { - text: gettext('Labeled'), + text: gettext('Inventory'), dataIndex: 'is-labeled', - width: 80, + flex: 1, renderer: function(value, mD, record) { if (!record.data['label-text']) { return ""; @@ -528,7 +538,15 @@ Ext.define('PBS.TapeManagement.ChangerStatus', { return ""; } - return Proxmox.Utils.format_boolean(value); + if (!value) { + return gettext('Not Labeled'); + } + + let status = record.data.status; + if (record.data.pool) { + return `${status} (${record.data.pool})`; + } + return status; }, }, { -- 2.20.1