[pbs-devel] [PATCH proxmox-backup 1/3] ui: tape/ChangerStatus: add Inventory column to drives/import-export

Dominik Csapak d.csapak at proxmox.com
Thu Feb 18 09:18:07 CET 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/tape/ChangerStatus.js | 52 +++++++++++++++++++++++++--------------
 1 file changed, 33 insertions(+), 19 deletions(-)

diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
index c51dea4b..9837481b 100644
--- a/www/tape/ChangerStatus.js
+++ b/www/tape/ChangerStatus.js
@@ -470,6 +470,26 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 		Proxmox.Utils.setErrorMask(me.lookup('content'), err);
 	    }
 	},
+
+	renderIsLabeled: function(value, mD, record) {
+	    if (!record.data['label-text']) {
+		return "";
+	    }
+
+	    if (record.data['label-text'].startsWith("CLN")) {
+		return "";
+	    }
+
+	    if (!value) {
+		return gettext('Not Labeled');
+	    }
+
+	    let status = record.data.status;
+	    if (record.data.pool) {
+		return `${status} (${record.data.pool})`;
+	    }
+	    return status;
+	},
     },
 
     listeners: {
@@ -551,26 +571,8 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 			{
 			    text: gettext('Inventory'),
 			    dataIndex: 'is-labeled',
+			    renderer: 'renderIsLabeled',
 			    flex: 1,
-			    renderer: function(value, mD, record) {
-				if (!record.data['label-text']) {
-				    return "";
-				}
-
-				if (record.data['label-text'].startsWith("CLN")) {
-				    return "";
-				}
-
-				if (!value) {
-				    return gettext('Not Labeled');
-				}
-
-				let status = record.data.status;
-				if (record.data.pool) {
-				    return `${status} (${record.data.pool})`;
-				}
-				return status;
-			    },
 			},
 			{
 			    text: gettext('Actions'),
@@ -626,6 +628,12 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 				    flex: 1,
 				    renderer: (value) => value || '',
 				},
+				{
+				    text: gettext('Inventory'),
+				    dataIndex: 'is-labeled',
+				    renderer: 'renderIsLabeled',
+				    flex: 1,
+				},
 				{
 				    text: gettext("Name"),
 				    sortable: true,
@@ -716,6 +724,12 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 				    renderer: (value) => value || '',
 				    flex: 1,
 				},
+				{
+				    text: gettext('Inventory'),
+				    dataIndex: 'is-labeled',
+				    renderer: 'renderIsLabeled',
+				    flex: 1,
+				},
 				{
 				    text: gettext('Actions'),
 				    xtype: 'actioncolumn',
-- 
2.20.1






More information about the pbs-devel mailing list