mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-23 03:58:45 -06:00
Finish layout for device view
This commit is contained in:
26
netbox/templates/dcim/panels/device_rack_elevations.html
Normal file
26
netbox/templates/dcim/panels/device_rack_elevations.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% load i18n %}
|
||||
{% if object.rack and object.position %}
|
||||
<div class="row" style="margin-bottom: 20px">
|
||||
<div class="text-center">
|
||||
<strong><a href="{% url 'dcim:rack' pk=object.rack.pk %}">{{ object.rack.name }}</a></strong>
|
||||
{% if object.rack.role %}
|
||||
<br /><span class="badge my-3" style="color: {{ object.rack.role.color|fgcolor }}; background-color: #{{ object.rack.role.color }}">{{ object.rack.role }}</span>
|
||||
{% endif %}
|
||||
{% if object.rack.facility_id %}
|
||||
<br /><small class="text-muted">{{ object.rack.facility_id }}</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
|
||||
<div style="margin-left: 30px">
|
||||
<h2 class="h4">{% trans "Front" %}</h2>
|
||||
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='front' extra_params=svg_extra %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-md-6 col-sm-6 col-xs-12 text-center">
|
||||
<div style="margin-left: 30px">
|
||||
<h2 class="h4">{% trans "Rear" %}</h2>
|
||||
{% include 'dcim/inc/rack_elevation.html' with object=object.rack face='rear' extra_params=svg_extra %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
50
netbox/templates/dcim/panels/power_utilization.html
Normal file
50
netbox/templates/dcim/panels/power_utilization.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{% extends "ui/panels/_base.html" %}
|
||||
{% load helpers i18n %}
|
||||
|
||||
{% block panel_content %}
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Input" %}</th>
|
||||
<th>{% trans "Outlets" %}</th>
|
||||
<th>{% trans "Allocated" %}</th>
|
||||
<th>{% trans "Available" %}</th>
|
||||
<th>{% trans "Utilization" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for powerport in object.powerports.all %}
|
||||
{% with utilization=powerport.get_power_draw powerfeed=powerport.connected_endpoints.0 %}
|
||||
<tr>
|
||||
<td>{{ powerport }}</td>
|
||||
<td>{{ utilization.outlet_count }}</td>
|
||||
<td>{{ utilization.allocated }}{% trans "VA" %}</td>
|
||||
{% if powerfeed.available_power %}
|
||||
<td>{{ powerfeed.available_power }}{% trans "VA" %}</td>
|
||||
<td>{% utilization_graph utilization.allocated|percentage:powerfeed.available_power %}</td>
|
||||
{% else %}
|
||||
<td class="text-muted">—</td>
|
||||
<td class="text-muted">—</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% for leg in utilization.legs %}
|
||||
<tr>
|
||||
<td style="padding-left: 20px">
|
||||
{% trans "Leg" context "Leg of a power feed" %} {{ leg.name }}
|
||||
</td>
|
||||
<td>{{ leg.outlet_count }}</td>
|
||||
<td>{{ leg.allocated }}</td>
|
||||
{% if powerfeed.available_power %}
|
||||
{% with phase_available=powerfeed.available_power|divide:3 %}
|
||||
<td>{{ phase_available }}{% trans "VA" %}</td>
|
||||
<td>{% utilization_graph leg.allocated|percentage:phase_available %}</td>
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<td class="text-muted">—</td>
|
||||
<td class="text-muted">—</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock panel_content %}
|
||||
Reference in New Issue
Block a user