From b96e437e2b6eb0b6d7a3c47a7ef71c15774805be Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 16 Aug 2023 10:10:31 -0400 Subject: [PATCH] #8248: Add bookmarks widget to default dashboard --- netbox/extras/constants.py | 50 +++++++++++-------- .../extras/dashboard/widgets/bookmarks.html | 7 +++ 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/netbox/extras/constants.py b/netbox/extras/constants.py index 6d9f78001..48b44fb45 100644 --- a/netbox/extras/constants.py +++ b/netbox/extras/constants.py @@ -19,6 +19,13 @@ WEBHOOK_EVENT_TYPES = { # Dashboard DEFAULT_DASHBOARD = [ + { + 'widget': 'extras.BookmarksWidget', + 'width': 4, + 'height': 5, + 'title': 'Bookmarks', + 'color': 'orange', + }, { 'widget': 'extras.ObjectCountsWidget', 'width': 4, @@ -32,22 +39,6 @@ DEFAULT_DASHBOARD = [ ] } }, - { - 'widget': 'extras.ObjectCountsWidget', - 'width': 4, - 'height': 3, - 'title': 'IPAM', - 'config': { - 'models': [ - 'ipam.vrf', - 'ipam.aggregate', - 'ipam.prefix', - 'ipam.iprange', - 'ipam.ipaddress', - 'ipam.vlan', - ] - } - }, { 'widget': 'extras.NoteWidget', 'width': 4, @@ -65,13 +56,16 @@ DEFAULT_DASHBOARD = [ { 'widget': 'extras.ObjectCountsWidget', 'width': 4, - 'height': 2, - 'title': 'Circuits', + 'height': 3, + 'title': 'IPAM', 'config': { 'models': [ - 'circuits.provider', - 'circuits.circuit', - 'circuits.providernetwork', + 'ipam.vrf', + 'ipam.aggregate', + 'ipam.prefix', + 'ipam.iprange', + 'ipam.ipaddress', + 'ipam.vlan', ] } }, @@ -86,6 +80,20 @@ DEFAULT_DASHBOARD = [ 'cache_timeout': 14400, } }, + { + 'widget': 'extras.ObjectCountsWidget', + 'width': 4, + 'height': 3, + 'title': 'Circuits', + 'config': { + 'models': [ + 'circuits.provider', + 'circuits.circuit', + 'circuits.providernetwork', + 'circuits.provideraccount', + ] + } + }, { 'widget': 'extras.ObjectCountsWidget', 'width': 4, diff --git a/netbox/templates/extras/dashboard/widgets/bookmarks.html b/netbox/templates/extras/dashboard/widgets/bookmarks.html index 2189cc55f..e8638d20e 100644 --- a/netbox/templates/extras/dashboard/widgets/bookmarks.html +++ b/netbox/templates/extras/dashboard/widgets/bookmarks.html @@ -1,3 +1,5 @@ +{% load i18n %} + {% if bookmarks %}
{% for bookmark in bookmarks %} @@ -6,4 +8,9 @@ {% endfor %}
+{% else %} +

+ + {% blocktrans %}No bookmarks have been added yet.{% endblocktrans %} +

{% endif %}