ADR-013 Phase 3: generic asset-panels renderer (Path A)

This commit is contained in:
2026-07-18 22:44:06 -04:00
parent 197b51f2b3
commit 72e3484497
7 changed files with 373 additions and 7 deletions

View File

@@ -83,7 +83,33 @@ class WarrantyPlugin(BasePlugin):
'title': 'Warranty',
'assettypes': ['*'],
'endpoint': '/api/warranty/asset/{assetid}',
'render': 'table',
'render': 'list',
# Field map: the generic renderer builds each list item from the
# warranty payload without any warranty-specific frontend code.
'map': {
'title': 'vendor',
'badge': {
'label': 'status',
'color': 'statuscolor',
'labelmap': {
'active': 'Active',
'expiring': 'Expiring Soon',
'expired': 'Expired',
'unknown': 'Unknown',
},
},
'meta': [
{'key': 'servicelevel'},
{'key': 'enddate', 'label': 'Ends', 'format': 'date'},
{'key': 'servicetag', 'label': 'Tag', 'mono': True},
],
},
'empty': 'No warranty on record.',
'manage': {
'to': '/warranties?addfor={assetid}',
'label': 'Add / manage',
'emptylabel': 'Add one',
},
'position': 30,
},
]