[pbs-devel] [PATCH proxmox-backup 4/4] ui: tape/ChangerStatus: disable drive buttons when it's blocked

Dominik Csapak d.csapak at proxmox.com
Mon Feb 22 14:25:37 CET 2021


if the drive state is not empty, some action blocks it, so we cannot
do any task anyway. Since we now refresh the state every 5 seconds,
we can disable/enable them 'live'.

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

diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
index 11b159ce..b1a294c4 100644
--- a/www/tape/ChangerStatus.js
+++ b/www/tape/ChangerStatus.js
@@ -795,35 +795,37 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 					    iconCls: 'fa fa-rotate-270 fa-upload',
 					    handler: 'unload',
 					    tooltip: gettext('Unload'),
-					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'],
+					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'] || rec.data['is-blocked'],
 					},
 					{
 					    iconCls: 'fa fa-hdd-o',
 					    handler: 'cartridgeMemory',
 					    tooltip: gettext('Cartridge Memory'),
-					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'],
+					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'] || rec.data['is-blocked'],
 					},
 					{
 					    iconCls: 'fa fa-line-chart',
 					    handler: 'volumeStatistics',
 					    tooltip: gettext('Volume Statistics'),
-					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'],
+					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'] || rec.data['is-blocked'],
 					},
 					{
 					    iconCls: 'fa fa-tag',
 					    handler: 'readLabel',
 					    tooltip: gettext('Read Label'),
-					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'],
+					    isDisabled: (v, r, c, i, rec) => !rec.data['label-text'] || rec.data['is-blocked'],
 					},
 					{
 					    iconCls: 'fa fa-info-circle',
 					    tooltip: gettext('Status'),
 					    handler: 'status',
+					    isDisabled: (v, r, c, i, rec) => rec.data['is-blocked'],
 					},
 					{
 					    iconCls: 'fa fa-shower',
 					    tooltip: gettext('Clean Drive'),
 					    handler: 'cleanDrive',
+					    isDisabled: (v, r, c, i, rec) => rec.data['is-blocked'],
 					},
 				    ],
 				},
-- 
2.20.1






More information about the pbs-devel mailing list