tabbed DNC card, machine-numbered downloads, themed backup history

This commit is contained in:
2026-08-07 15:22:59 -04:00
parent 2487981d91
commit 3ebc1f353a
9 changed files with 233 additions and 50 deletions

View File

@@ -152,10 +152,13 @@ def build(projection, assetid, partmarkertypes=None):
sections.append(('MARK (part marker)',
_fields(mark, mono=('DataPath', 'MarkMasterPath'))))
fields = []
for title, entries in sections:
if not entries:
continue
fields.append({'label': title, 'value': '', 'heading': True})
fields.extend(entries)
return {'fields': fields, 'sectioncount': len(sections)}
# Emitted as SECTIONS for the tabs renderer: one visible at a time, so the
# card stays the height of its largest section. Flattened into one list it
# ran to 30 rows, which the two-column multicol layout cannot split, so it
# dragged one column far past the other.
#
# Everything DNC lives on this one card - General, the interface sections
# and MARK - rather than MARK getting a card of its own.
out = [{'label': title, 'fields': entries}
for title, entries in sections if entries]
return {'sections': out, 'sectioncount': len(out)}

View File

@@ -180,10 +180,11 @@ class NtlarsKind(BackupKind):
'title': 'DNC Info',
'assettypes': ['machine'],
'endpoint': '/api/backups/asset/{assetid}/info?kind=ntlars',
# No 'empty' key: the keyvalue renderer decides visibility purely on
# field count and never displays empty text, so a machine with no
# NTLARS revision simply has no DNC Info card at all.
'render': 'keyvalue',
# tabs, not keyvalue: General / eFocas / Serial / NTSHR / MARK are
# one card the tech switches between, rather than a 30-row wall.
# No 'empty' key - the renderer hides a panel with no sections, so
# a machine with no NTLARS revision has no DNC Info card at all.
'render': 'tabs',
# Above the history panels: this answers the question a tech
# arrives with, while history is for the rarer restore case.
'position': 38,
@@ -219,7 +220,11 @@ class PartMarkerKind(BackupKind):
key = 'partmarker'
displayname = 'Part Marker Configuration'
storagebackend = 'share'
assettypes = ['machine', 'measuring_tool']
# NO asset panel. The marker's DNC settings are a tab on the single DNC Info
# card, and a separate card that is empty on 145 of 147 machines earns
# nobody anything. The kind is still fully live - it stores, dedupes and
# serves revisions, which are listed on the backup history page.
assettypes = []
def resolveassetid(self, payload):
from shopdb.api import db, Asset