mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #6125: Add locations count to home page
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
* [#6097](https://github.com/netbox-community/netbox/issues/6097) - Redirect old slug-based object views
|
||||
* [#6109](https://github.com/netbox-community/netbox/issues/6109) - Add device counts to locations table
|
||||
* [#6125](https://github.com/netbox-community/netbox/issues/6125) - Add locations count to home page
|
||||
|
||||
### Bug Fixes (from Beta)
|
||||
|
||||
|
@ -16,7 +16,7 @@ from packaging import version
|
||||
|
||||
from circuits.models import Circuit, Provider
|
||||
from dcim.models import (
|
||||
Cable, ConsolePort, Device, DeviceType, Interface, PowerPanel, PowerFeed, PowerPort, Rack, Site,
|
||||
Cable, ConsolePort, Device, DeviceType, Interface, Location, PowerPanel, PowerFeed, PowerPort, Rack, Site,
|
||||
)
|
||||
from extras.choices import JobResultStatusChoices
|
||||
from extras.models import ObjectChange, JobResult
|
||||
@ -56,6 +56,7 @@ class HomeView(View):
|
||||
|
||||
# Organization
|
||||
'site_count': Site.objects.restrict(request.user, 'view').count(),
|
||||
'location_count': Location.objects.restrict(request.user, 'view').count(),
|
||||
'tenant_count': Tenant.objects.restrict(request.user, 'view').count(),
|
||||
|
||||
# DCIM
|
||||
|
@ -31,7 +31,17 @@
|
||||
<span class="badge pull-right"><i class="mdi mdi-lock"></i></span>
|
||||
<h4 class="list-group-item-heading">Sites</h4>
|
||||
{% endif %}
|
||||
<p class="list-group-item-text text-muted">Geographic locations</p>
|
||||
<p class="list-group-item-text text-muted">Discrete points of presence</p>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
{% if perms.dcim.view_location %}
|
||||
<span class="badge pull-right">{{ stats.location_count }}</span>
|
||||
<h4 class="list-group-item-heading"><a href="{% url 'dcim:location_list' %}">Locations</a></h4>
|
||||
{% else %}
|
||||
<span class="badge pull-right"><i class="mdi mdi-lock"></i></span>
|
||||
<h4 class="list-group-item-heading">Locations</h4>
|
||||
{% endif %}
|
||||
<p class="list-group-item-text text-muted">Locations within sites</p>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
{% if perms.tenancy.view_tenant %}
|
||||
|
Reference in New Issue
Block a user