From 2f2e273776d49c5533e57a0f3710fb5419f5c1c2 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Fri, 12 Jul 2024 14:08:46 -0400 Subject: [PATCH] Add event icon & type to notifications table --- netbox/extras/tables/tables.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/netbox/extras/tables/tables.py b/netbox/extras/tables/tables.py index 23c8cff5a..23786778d 100644 --- a/netbox/extras/tables/tables.py +++ b/netbox/extras/tables/tables.py @@ -287,6 +287,15 @@ class SubscriptionTable(NetBoxTable): class NotificationTable(NetBoxTable): + icon = columns.TemplateColumn( + template_code='', + accessor=tables.A('event'), + attrs={ + 'td': {'class': 'w-1'}, + 'th': {'class': 'w-1'}, + }, + verbose_name='' + ) object_type = columns.ContentTypeColumn( verbose_name=_('Object Type'), ) @@ -312,8 +321,8 @@ class NotificationTable(NetBoxTable): class Meta(NetBoxTable.Meta): model = Notification - fields = ('pk', 'object', 'object_type', 'created', 'read') - default_columns = ('object', 'object_type', 'created', 'read') + fields = ('pk', 'icon', 'object', 'object_type', 'event_type', 'created', 'read') + default_columns = ('icon', 'object', 'object_type', 'event_type', 'created', 'read') row_attrs = { 'data-unread': lambda record: not record.read, }