backups: one tabbed DNC card, machine-numbered downloads, themed history
DNC Info becomes a single tabbed card - General, eFocas, Serial, NTSHR and MARK - instead of a flat wall of every value. On 3204 that is 11 rows visible rather than 22, and on 0600 eleven rather than 27, which also stops the card unbalancing the detail page's two-column layout. Everything DNC now lives on that one card, so the Part Marker panel is gone: its settings are the MARK tab. The partmarker KIND is untouched and still stores, dedupes and serves revisions - they are listed on the backup history page - it simply contributes no card of its own, which on 145 of 147 machines would have been an empty box. Downloads are named for the machine: 3204.reg, and 3204-wow6432node.reg for the dialect that imports outside NTLARS. The view had been rebuilding the name from sourcefilename and producing 3204.reg-wow6432node.reg, so the revision now carries assetnumber and both ends agree. That needed a viewonly relationship to Asset - no backref, so the core asset side gains no dependency on this plugin. The history page was hardcoded to light colours (#e0e0e0, #f4f9ff, #666) and rendered as a white table on a dark page. It now uses the palette variables throughout, per frontend/CLAUDE.md. The current-revision tint is a color-mix against --primary so it reads in both themes rather than a baked light blue that disappears on dark, and the diff columns are headed as well as red/green, since colour alone does not survive a colourblind reader.
This commit is contained in:
@@ -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)}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user