Skip to content

Commit

Permalink
#8248: Add bookmarks widget to default dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Aug 16, 2023
1 parent 0457520 commit b96e437
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 21 deletions.
50 changes: 29 additions & 21 deletions netbox/extras/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@

# Dashboard
DEFAULT_DASHBOARD = [
{
'widget': 'extras.BookmarksWidget',
'width': 4,
'height': 5,
'title': 'Bookmarks',
'color': 'orange',
},
{
'widget': 'extras.ObjectCountsWidget',
'width': 4,
Expand All @@ -32,22 +39,6 @@
]
}
},
{
'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,
Expand All @@ -65,13 +56,16 @@
{
'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',
]
}
},
Expand All @@ -86,6 +80,20 @@
'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,
Expand Down
7 changes: 7 additions & 0 deletions netbox/templates/extras/dashboard/widgets/bookmarks.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% load i18n %}

{% if bookmarks %}
<div class="list-group list-group-flush">
{% for bookmark in bookmarks %}
Expand All @@ -6,4 +8,9 @@
</a>
{% endfor %}
</div>
{% else %}
<p class="text-center text-muted">
<i class="mdi mdi-information-outline"></i>
{% blocktrans %}No bookmarks have been added yet.{% endblocktrans %}
</p>
{% endif %}

0 comments on commit b96e437

Please sign in to comment.