Give the backups plugin a settings page, and show where a snapshot is

This commit is contained in:
2026-08-25 14:53:13 -04:00
parent fa856c1f94
commit 8e10584c4d
8 changed files with 287 additions and 3 deletions

View File

@@ -91,7 +91,7 @@ def _summarise(files):
def build(projection, assetid, revisionid=None, sourcehostname=None,
**options):
sharepath=None, **options):
"""Build the card from a stored partmarker manifest.
Returns the keyvalue shape. An older revision predating manifests has no
@@ -128,6 +128,14 @@ def build(projection, assetid, revisionid=None, sourcehostname=None,
if systems:
fields.append({'label': 'Authored for', 'value': ', '.join(systems)})
# The snapshot's own location, in full, as plain text. NOT a link: browsers
# refuse to navigate from an https page to file://, so a clickable path
# would look actionable and silently do nothing, which is worse than no
# link at all. The history page pairs the same string with a copy button;
# here it is what a tech reads or selects before pasting it into Explorer.
if sharepath:
fields.append({'label': 'Snapshot', 'value': sharepath, 'mono': True})
# From the revision's own column where the caller passes it: the manifest
# carries its own copy, and the two can disagree. The column is what the
# collector recorded and what the diff above is chained on, so naming a

View File

@@ -332,7 +332,8 @@ class PartMarkerKind(BackupKind):
return partmarkerinfo.build(
projection, assetid,
revisionid=options.get('revisionid'),
sourcehostname=options.get('sourcehostname'))
sourcehostname=options.get('sourcehostname'),
sharepath=options.get('sharepath'))
def resolveassetid(self, payload):
from shopdb.api import db, Asset