ui: use isActionDisabled

isDisabled is deprecated for actions in actioncolumns
(it produces a warning for now)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-05-26 11:12:05 +02:00 committed by Thomas Lamprecht
parent c23192d34e
commit 4e0faf5ef3
3 changed files with 16 additions and 16 deletions

View File

@ -632,19 +632,19 @@ Ext.define('PBS.DataStoreContent', {
handler: 'onVerify', handler: 'onVerify',
getTip: (v, m, rec) => Ext.String.format(gettext("Verify '{0}'"), v), getTip: (v, m, rec) => Ext.String.format(gettext("Verify '{0}'"), v),
getClass: (v, m, rec) => rec.data.leaf ? 'pmx-hidden' : 'pve-icon-verify-lettering', getClass: (v, m, rec) => rec.data.leaf ? 'pmx-hidden' : 'pve-icon-verify-lettering',
isDisabled: (v, r, c, i, rec) => !!rec.data.leaf, isActionDisabled: (v, r, c, i, rec) => !!rec.data.leaf,
}, },
{ {
handler: 'onChangeOwner', handler: 'onChangeOwner',
getClass: (v, m, rec) => rec.parentNode.id ==='root' ? 'fa fa-user' : 'pmx-hidden', getClass: (v, m, rec) => rec.parentNode.id ==='root' ? 'fa fa-user' : 'pmx-hidden',
getTip: (v, m, rec) => Ext.String.format(gettext("Change owner of '{0}'"), v), getTip: (v, m, rec) => Ext.String.format(gettext("Change owner of '{0}'"), v),
isDisabled: (v, r, c, i, rec) => rec.parentNode.id !=='root', isActionDisabled: (v, r, c, i, rec) => rec.parentNode.id !=='root',
}, },
{ {
handler: 'onPrune', handler: 'onPrune',
getTip: (v, m, rec) => Ext.String.format(gettext("Prune '{0}'"), v), getTip: (v, m, rec) => Ext.String.format(gettext("Prune '{0}'"), v),
getClass: (v, m, rec) => rec.parentNode.id ==='root' ? 'fa fa-scissors' : 'pmx-hidden', getClass: (v, m, rec) => rec.parentNode.id ==='root' ? 'fa fa-scissors' : 'pmx-hidden',
isDisabled: (v, r, c, i, rec) => rec.parentNode.id !=='root', isActionDisabled: (v, r, c, i, rec) => rec.parentNode.id !=='root',
}, },
{ {
handler: 'onForget', handler: 'onForget',
@ -652,13 +652,13 @@ Ext.define('PBS.DataStoreContent', {
? Ext.String.format(gettext("Permanently forget snapshot '{0}'"), v) ? Ext.String.format(gettext("Permanently forget snapshot '{0}'"), v)
: Ext.String.format(gettext("Permanently forget group '{0}'"), v), : Ext.String.format(gettext("Permanently forget group '{0}'"), v),
getClass: (v, m, rec) => !rec.data.leaf ? 'fa critical fa-trash-o' : 'pmx-hidden', getClass: (v, m, rec) => !rec.data.leaf ? 'fa critical fa-trash-o' : 'pmx-hidden',
isDisabled: (v, r, c, i, rec) => !!rec.data.leaf, isActionDisabled: (v, r, c, i, rec) => !!rec.data.leaf,
}, },
{ {
handler: 'downloadFile', handler: 'downloadFile',
getTip: (v, m, rec) => Ext.String.format(gettext("Download '{0}'"), v), getTip: (v, m, rec) => Ext.String.format(gettext("Download '{0}'"), v),
getClass: (v, m, rec) => rec.data.leaf && rec.data.filename ? 'fa fa-download' : 'pmx-hidden', getClass: (v, m, rec) => rec.data.leaf && rec.data.filename ? 'fa fa-download' : 'pmx-hidden',
isDisabled: (v, r, c, i, rec) => !rec.data.leaf || !rec.data.filename || rec.data['crypt-mode'] > 2, isActionDisabled: (v, r, c, i, rec) => !rec.data.leaf || !rec.data.filename || rec.data['crypt-mode'] > 2,
}, },
{ {
handler: 'openPxarBrowser', handler: 'openPxarBrowser',
@ -670,7 +670,7 @@ Ext.define('PBS.DataStoreContent', {
} }
return 'pmx-hidden'; return 'pmx-hidden';
}, },
isDisabled: (v, r, c, i, rec) => { isActionDisabled: (v, r, c, i, rec) => {
let data = rec.data; let data = rec.data;
return !(data.leaf && return !(data.leaf &&
data.filename && data.filename &&

View File

@ -302,7 +302,7 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
return Ext.String.format(gettext("Open restore wizard for {0}"), v); return Ext.String.format(gettext("Open restore wizard for {0}"), v);
}, },
getClass: (v, m, rec) => rec.data.restore ? 'fa fa-fw fa-undo' : 'pmx-hidden', getClass: (v, m, rec) => rec.data.restore ? 'fa fa-fw fa-undo' : 'pmx-hidden',
isDisabled: (v, r, c, i, rec) => !rec.data.restore, isActionDisabled: (v, r, c, i, rec) => !rec.data.restore,
}, },
], ],
}, },

View File

@ -747,19 +747,19 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
iconCls: 'fa fa-rotate-90 fa-exchange', iconCls: 'fa fa-rotate-90 fa-exchange',
handler: 'slotTransfer', handler: 'slotTransfer',
tooltip: gettext('Transfer'), tooltip: gettext('Transfer'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'],
}, },
{ {
iconCls: 'fa fa-trash-o', iconCls: 'fa fa-trash-o',
handler: 'format', handler: 'format',
tooltip: gettext('Format'), tooltip: gettext('Format'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'],
}, },
{ {
iconCls: 'fa fa-rotate-90 fa-upload', iconCls: 'fa fa-rotate-90 fa-upload',
handler: 'load', handler: 'load',
tooltip: gettext('Load'), tooltip: gettext('Load'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'],
}, },
], ],
}, },
@ -885,31 +885,31 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
iconCls: 'fa fa-rotate-270 fa-upload', iconCls: 'fa fa-rotate-270 fa-upload',
handler: 'unload', handler: 'unload',
tooltip: gettext('Unload'), tooltip: gettext('Unload'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'],
}, },
{ {
iconCls: 'fa fa-hdd-o', iconCls: 'fa fa-hdd-o',
handler: 'cartridgeMemory', handler: 'cartridgeMemory',
tooltip: gettext('Cartridge Memory'), tooltip: gettext('Cartridge Memory'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'],
}, },
{ {
iconCls: 'fa fa-line-chart', iconCls: 'fa fa-line-chart',
handler: 'volumeStatistics', handler: 'volumeStatistics',
tooltip: gettext('Volume Statistics'), tooltip: gettext('Volume Statistics'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'],
}, },
{ {
iconCls: 'fa fa-tag', iconCls: 'fa fa-tag',
handler: 'readLabel', handler: 'readLabel',
tooltip: gettext('Read Label'), tooltip: gettext('Read Label'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'] || rec.data['is-blocked'],
}, },
{ {
iconCls: 'fa fa-info-circle', iconCls: 'fa fa-info-circle',
tooltip: gettext('Status'), tooltip: gettext('Status'),
handler: 'status', handler: 'status',
isDisabled: (v, r, c, i, rec) => rec.data['is-blocked'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-blocked'],
}, },
], ],
}, },
@ -953,7 +953,7 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
iconCls: 'fa fa-rotate-270 fa-upload', iconCls: 'fa fa-rotate-270 fa-upload',
handler: 'importTape', handler: 'importTape',
tooltip: gettext('Import'), tooltip: gettext('Import'),
isDisabled: (v, r, c, i, rec) => rec.data['is-empty'], isActionDisabled: (v, r, c, i, rec) => rec.data['is-empty'],
}, },
], ],
width: 80, width: 80,