[pbs-devel] [PATCH proxmox-backup 7/7] ui: tape/DriveStatus: improve status grid a bit

Dominik Csapak d.csapak at proxmox.com
Thu Apr 8 13:39:20 CEST 2021


by using format_boolean for compression/write protect,
combining file/block posiition into one (saves a line)

and adding the missing alert-flags

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

diff --git a/www/tape/DriveStatus.js b/www/tape/DriveStatus.js
index e965bac1..cd001bff 100644
--- a/www/tape/DriveStatus.js
+++ b/www/tape/DriveStatus.js
@@ -317,6 +317,7 @@ Ext.define('PBS.TapeManagement.DriveStatusGrid', {
 	    required: true,
 	    header: gettext('Write Protect'),
 	    defaultValue: false,
+	    renderer: Proxmox.Utils.format_boolean,
 	},
 	'buffer-mode': {
 	    required: true,
@@ -325,12 +326,23 @@ Ext.define('PBS.TapeManagement.DriveStatusGrid', {
 	'compression': {
 	    required: true,
 	    header: gettext('Compression'),
+	    renderer: Proxmox.Utils.format_boolean,
 	},
 	'file-number': {
-	    header: gettext('File Number'),
+	    header: gettext('Tape Position'),
+	    renderer: function(value, mD, r, rI, cI, store) {
+		let me = this;
+		let filenr = value;
+		let rec = store.getById('block-number');
+		if (rec) {
+		    let blocknr = rec.data.value;
+		    return `File ${filenr}, Block ${blocknr}`;
+		}
+		return `File ${filenr}`;
+	    },
 	},
 	'block-number': {
-	    header: gettext('Block Number'),
+	    visible: false,
 	},
 	'manufactured': {
 	    header: gettext('Tape Manufacture Date'),
@@ -361,6 +373,9 @@ Ext.define('PBS.TapeManagement.DriveStatusGrid', {
 		return value;
 	    },
 	},
+	'alert-flags': {
+	    header: gettext('Alert Flags'),
+	},
     },
 });
 
-- 
2.20.1






More information about the pbs-devel mailing list