ui: tape/ChangerStatus: disable drive buttons when it's blocked

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@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-02-22 14:25:37 +01:00 committed by Dietmar Maurer
parent a83cedc2ac
commit e63457b6b2

View File

@ -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'],
},
],
},