* [pbs-devel] [PATCH proxmox-backup] ui: tape: mark incomplete media-sets as such
@ 2023-09-29 8:52 Dominik Csapak
2023-11-08 15:38 ` [pbs-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-09-29 8:52 UTC (permalink / raw)
To: pbs-devel
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>
---
i opted to not deduplicated the checking logic because it's only three
lines and we don't have a good place to put it besides Utils.
If wanted i can ofc do that and send a v2
www/tape/BackupOverview.js | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/www/tape/BackupOverview.js b/www/tape/BackupOverview.js
index 229d8d9d..f8e9dfd7 100644
--- a/www/tape/BackupOverview.js
+++ b/www/tape/BackupOverview.js
@@ -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,
},
--
2.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup] ui: tape: mark incomplete media-sets as such
2023-09-29 8:52 [pbs-devel] [PATCH proxmox-backup] ui: tape: mark incomplete media-sets as such Dominik Csapak
@ 2023-11-08 15:38 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-11-08 15:38 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Dominik Csapak
Am 29/09/2023 um 10:52 schrieb Dominik Csapak:
> 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>
> ---
> i opted to not deduplicated the checking logic because it's only three
> lines and we don't have a good place to put it besides Utils.
> If wanted i can ofc do that and send a v2
>
> www/tape/BackupOverview.js | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-08 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29 8:52 [pbs-devel] [PATCH proxmox-backup] ui: tape: mark incomplete media-sets as such Dominik Csapak
2023-11-08 15:38 ` [pbs-devel] applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal