mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Merge pull request #3308 from mmahacek/powerpanel-count
Add Powerpanel count to home page
This commit is contained in:
@ -15,7 +15,7 @@ from dcim.filters import (
|
||||
VirtualChassisFilter,
|
||||
)
|
||||
from dcim.models import (
|
||||
Cable, ConsolePort, Device, DeviceType, Interface, PowerFeed, PowerPort, Rack, RackGroup, Site, VirtualChassis
|
||||
Cable, ConsolePort, Device, DeviceType, Interface, PowerPanel, PowerFeed, PowerPort, Rack, RackGroup, Site, VirtualChassis
|
||||
)
|
||||
from dcim.tables import (
|
||||
CableTable, DeviceDetailTable, DeviceTypeTable, PowerFeedTable, RackTable, RackGroupTable, SiteTable,
|
||||
@ -196,6 +196,7 @@ class HomeView(View):
|
||||
'cable_count': cables.count(),
|
||||
'console_connections_count': connected_consoleports.count(),
|
||||
'power_connections_count': connected_powerports.count(),
|
||||
'powerpanel_count': PowerPanel.objects.count(),
|
||||
'powerfeed_count': PowerFeed.objects.count(),
|
||||
|
||||
# IPAM
|
||||
|
@ -115,6 +115,16 @@
|
||||
{% endif %}
|
||||
<p class="list-group-item-text text-muted">Electrical circuits delivering power from panels</p>
|
||||
</div>
|
||||
<div class="list-group-item">
|
||||
{% if perms.dcim.view_powerpanel %}
|
||||
<span class="badge pull-right">{{ stats.powerpanel_count }}</span>
|
||||
<h4 class="list-group-item-heading"><a href="{% url 'dcim:powerpanel_list' %}">Power Panels</a></h4>
|
||||
{% else %}
|
||||
<span class="badge pull-right"><i class="fa fa-lock"></i></span>
|
||||
<h4 class="list-group-item-heading">Power Panels</h4>
|
||||
{% endif %}
|
||||
<p class="list-group-item-text text-muted">Electrical panels receiving utility power</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
|
Reference in New Issue
Block a user