diff --git a/plugins/backups/api/routes.py b/plugins/backups/api/routes.py index 26953834..a45e6e87 100644 --- a/plugins/backups/api/routes.py +++ b/plugins/backups/api/routes.py @@ -116,13 +116,25 @@ def asset_revisions(assetid): revisions = query.order_by(BackupRevision.backuprevisionid.desc()).all() - # "Latest" is per kind, not per asset, so an unfiltered listing still marks - # the current revision of each kind correctly. + # "Latest" is per kind AND per source chain. Per kind alone was wrong on + # the case this exists for: NTLARS settings describe a machine but are read + # off the controlling PC, so a machine with two reporting PCs has two + # independent chains of the same kind. Marking only the highest revision id + # meant the second PC's current revision was badged as history and lost its + # "last verified" stamp - the machine looked like it had one source that + # kept re-reporting, rather than two. + # + # sourcehostname is the chain: it records which PC produced the revision. + # A revision with none (an older row, or a share-drop with no host) forms + # its own chain under the empty key, which keeps the per-kind behaviour for + # everything that has only ever had one source. seen = set() out = [] for revision in revisions: - islatest = revision.backupkind not in seen - seen.add(revision.backupkind) + chain = (revision.backupkind, + (revision.sourcehostname or '').strip().lower()) + islatest = chain not in seen + seen.add(chain) out.append(_summary(revision, islatest=islatest)) return success_response(out) diff --git a/plugins/printers/frontend/views/TonerReport.vue b/plugins/printers/frontend/views/TonerReport.vue index 22126aad..906b4466 100644 --- a/plugins/printers/frontend/views/TonerReport.vue +++ b/plugins/printers/frontend/views/TonerReport.vue @@ -17,8 +17,18 @@