Dashboard cards: rebuild deployable dists
This commit is contained in:
@@ -287,14 +287,28 @@ class PrintersPlugin(BasePlugin):
|
||||
return [printerscli]
|
||||
|
||||
def get_dashboard_widgets(self) -> List[Dict]:
|
||||
"""Return dashboard widget definitions."""
|
||||
"""Dashboard card: printers needing a cartridge.
|
||||
|
||||
Replaces a declaration naming a component nobody wrote. Reuses the
|
||||
low-supplies query and its cache - a Zabbix round-trip per printer on
|
||||
every dashboard load would make this the slowest page in the app.
|
||||
"""
|
||||
return [
|
||||
{
|
||||
'name': 'Printer Status',
|
||||
'component': 'PrinterStatusWidget',
|
||||
'endpoint': '/api/printers/dashboard/summary',
|
||||
'size': 'medium',
|
||||
'position': 10,
|
||||
'id': 'printers-supplies',
|
||||
'title': 'Printer supplies',
|
||||
'endpoint': '/api/printers/dashboard/supplies',
|
||||
'render': 'exceptions',
|
||||
'severity': 'warning',
|
||||
'permission': 'printers.view',
|
||||
'empty': 'hide',
|
||||
'position': 40,
|
||||
'map': {
|
||||
'title': 'printername',
|
||||
'detail': 'supplies',
|
||||
'meta': [{'key': 'location'}, {'key': 'status'}],
|
||||
'link': '/printers/{printerid}',
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user