Dashboard cards: rebuild deployable dists

This commit is contained in:
2026-08-11 14:31:24 -04:00
parent 0ed8be75d9
commit 3b37603691
14 changed files with 507 additions and 62 deletions

View File

@@ -193,14 +193,30 @@ class NotificationsPlugin(BasePlugin):
return [notifications_cli]
def get_dashboard_widgets(self) -> List[Dict]:
"""Return dashboard widget definitions."""
"""Dashboard card: what the floor is being shown right now.
The items, not a count. "4 active notifications" tells an admin
nothing; knowing WHICH message is on the boards is the point, and it is
how a stale one gets noticed and taken down.
Replaces a declaration naming a component nobody wrote.
"""
return [
{
'name': 'Active Notifications',
'component': 'NotificationsWidget',
'endpoint': '/api/notifications/dashboard/summary',
'size': 'small',
'position': 1,
'id': 'notifications-active',
'title': 'Active notifications',
'endpoint': '/api/notifications/dashboard/active',
'render': 'list',
'severity': 'info',
'empty': 'hide',
'position': 60,
'map': {
'title': 'typename',
'detail': 'message',
'meta': [{'key': 'endtime', 'label': 'until',
'format': 'date'}],
'link': '/notifications/{notificationid}',
},
},
]