mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-01-07 17:18:03 +03:00
ui: tape: mark incomplete media-sets as such
by counting the returned tapes and compare it to the sequence number. If the tape count is lower than the highest sequence number plus one, there must be a tape missing. Mark it in the text and add the proxmox-warning-row class. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
bdf327d35f
commit
be79c2bb6e
@ -55,17 +55,24 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
|
||||
data[pool] = {};
|
||||
}
|
||||
|
||||
let seq_nr = entry['seq-nr'];
|
||||
|
||||
if (data[pool][media_set] === undefined) {
|
||||
data[pool][media_set] = entry;
|
||||
data[pool][media_set].text = media_set;
|
||||
data[pool][media_set].restore = true;
|
||||
data[pool][media_set].tapes = 1;
|
||||
data[pool][media_set]['seq-nr'] = undefined;
|
||||
data[pool][media_set]['max-seq-nr'] = seq_nr;
|
||||
data[pool][media_set].is_media_set = true;
|
||||
data[pool][media_set].typeText = 'media-set';
|
||||
} else {
|
||||
data[pool][media_set].tapes++;
|
||||
}
|
||||
|
||||
if (data[pool][media_set]['max-seq-nr'] < seq_nr) {
|
||||
data[pool][media_set]['max-seq-nr'] = seq_nr;
|
||||
}
|
||||
}
|
||||
|
||||
let list = [];
|
||||
@ -309,11 +316,33 @@ Ext.define('PBS.TapeManagement.BackupOverview', {
|
||||
},
|
||||
],
|
||||
|
||||
viewConfig: {
|
||||
getRowClass: function(rec) {
|
||||
let tapeCount = (rec.get('max-seq-nr') ?? 0) + 1;
|
||||
let actualTapeCount = rec.get('tapes') ?? 1;
|
||||
|
||||
if (tapeCount !== actualTapeCount) {
|
||||
return 'proxmox-warning-row';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
},
|
||||
|
||||
columns: [
|
||||
{
|
||||
xtype: 'treecolumn',
|
||||
text: gettext('Pool/Media-Set/Snapshot'),
|
||||
dataIndex: 'text',
|
||||
renderer: function(value, mD, rec) {
|
||||
let tapeCount = (rec.get('max-seq-nr') ?? 0) + 1;
|
||||
let actualTapeCount = rec.get('tapes') ?? 1;
|
||||
|
||||
if (tapeCount !== actualTapeCount) {
|
||||
return `${value} (${gettext('Incomplete')})`;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
sortable: false,
|
||||
flex: 3,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user