1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#8248: Add bookmarks widget to default dashboard

This commit is contained in:
Jeremy Stretch
2023-08-16 10:10:31 -04:00
parent 0457520f51
commit b96e437e2b
2 changed files with 36 additions and 21 deletions

View File

@ -19,6 +19,13 @@ WEBHOOK_EVENT_TYPES = {
# Dashboard # Dashboard
DEFAULT_DASHBOARD = [ DEFAULT_DASHBOARD = [
{
'widget': 'extras.BookmarksWidget',
'width': 4,
'height': 5,
'title': 'Bookmarks',
'color': 'orange',
},
{ {
'widget': 'extras.ObjectCountsWidget', 'widget': 'extras.ObjectCountsWidget',
'width': 4, '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', 'widget': 'extras.NoteWidget',
'width': 4, 'width': 4,
@ -65,13 +56,16 @@ DEFAULT_DASHBOARD = [
{ {
'widget': 'extras.ObjectCountsWidget', 'widget': 'extras.ObjectCountsWidget',
'width': 4, 'width': 4,
'height': 2, 'height': 3,
'title': 'Circuits', 'title': 'IPAM',
'config': { 'config': {
'models': [ 'models': [
'circuits.provider', 'ipam.vrf',
'circuits.circuit', 'ipam.aggregate',
'circuits.providernetwork', 'ipam.prefix',
'ipam.iprange',
'ipam.ipaddress',
'ipam.vlan',
] ]
} }
}, },
@ -86,6 +80,20 @@ DEFAULT_DASHBOARD = [
'cache_timeout': 14400, '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', 'widget': 'extras.ObjectCountsWidget',
'width': 4, 'width': 4,

View File

@ -1,3 +1,5 @@
{% load i18n %}
{% if bookmarks %} {% if bookmarks %}
<div class="list-group list-group-flush"> <div class="list-group list-group-flush">
{% for bookmark in bookmarks %} {% for bookmark in bookmarks %}
@ -6,4 +8,9 @@
</a> </a>
{% endfor %} {% endfor %}
</div> </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 %} {% endif %}