ui: tape overview: include more context in restore tooltips

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-05-26 19:02:58 +02:00
parent 9a535ec77b
commit f9b824ac30
1 changed files with 12 additions and 2 deletions

View File

@ -58,10 +58,11 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
if (data[pool][media_set] === undefined) { if (data[pool][media_set] === undefined) {
data[pool][media_set] = entry; data[pool][media_set] = entry;
data[pool][media_set].text = media_set; data[pool][media_set].text = media_set;
data[pool][media_set].restore =true; data[pool][media_set].restore = true;
data[pool][media_set].tapes = 1; data[pool][media_set].tapes = 1;
data[pool][media_set]['seq-nr'] = undefined; data[pool][media_set]['seq-nr'] = undefined;
data[pool][media_set].is_media_set = true; data[pool][media_set].is_media_set = true;
data[pool][media_set].typeText = 'media-set';
} else { } else {
data[pool][media_set].tapes++; data[pool][media_set].tapes++;
} }
@ -161,6 +162,7 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
text: store, text: store,
'media-set-uuid': entry['media-set-uuid'], 'media-set-uuid': entry['media-set-uuid'],
iconCls: 'fa fa-database', iconCls: 'fa fa-database',
typeText: 'datastore',
restore: true, restore: true,
'media-set': media_set, 'media-set': media_set,
prefilter: { prefilter: {
@ -196,6 +198,7 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
}, },
'media-set': media_set, 'media-set': media_set,
iconCls: `fa ${iconCls}`, iconCls: `fa ${iconCls}`,
typeText: `group`,
children: [], children: [],
}); });
} }
@ -283,10 +286,17 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
{ {
header: gettext('Restore'), header: gettext('Restore'),
xtype: 'actioncolumn', xtype: 'actioncolumn',
dataIndex: 'text',
items: [ items: [
{ {
handler: 'restoreBackups', handler: 'restoreBackups',
tooltip: gettext('Restore'), getTip: (v, m, rec) => {
let typeText = rec.get('typeText');
if (typeText) {
v = `${typeText} '${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, isDisabled: (v, r, c, i, rec) => !rec.data.restore,
}, },