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

More power work

This commit is contained in:
Jeremy Stretch
2019-03-12 11:36:29 -04:00
parent 3b9c0e4c67
commit e06dece00c
11 changed files with 230 additions and 91 deletions

View File

@@ -9,13 +9,13 @@
{% render_field form.power_panel %}
{% render_field form.rack %}
{% render_field form.name %}
{% render_field form.type %}
{% render_field form.status %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>Characteristics</strong></div>
<div class="panel-body">
{% render_field form.type %}
{% render_field form.supply %}
{% render_field form.voltage %}
{% render_field form.amperage %}

View File

@@ -190,47 +190,37 @@
{% endif %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<strong>Non-Racked Devices</strong>
</div>
{% if nonracked_devices %}
<table class="table table-hover panel-body">
{% if power_feeds %}
<div class="panel panel-default">
<div class="panel-heading">
<strong>Power Feeds</strong>
</div>
<table class="table panel-body">
<tr>
<th>Name</th>
<th>Role</th>
<th>Panel</th>
<th>Feed</th>
<th>Status</th>
<th>Type</th>
<th>Parent</th>
</tr>
{% for device in nonracked_devices %}
<tr{% if device.device_type.u_height %} class="warning"{% endif %}>
{% for powerfeed in power_feeds %}
<tr>
<td>
<a href="{% url 'dcim:device' pk=device.pk %}">{{ device }}</a>
<a href="{{ powerfeed.power_panel.get_absolute_url }}">{{ powerfeed.power_panel.name }}</a>
<td>
<a href="{{ powerfeed.get_absolute_url }}">{{ powerfeed.name }}</a>
</td>
<td>{{ device.device_role }}</td>
<td>{{ device.device_type.display_name }}</td>
<td>
{% if device.parent_bay %}
<a href="{{ device.parent_bay.device.get_absolute_url }}">{{ device.parent_bay }}</a>
{% else %}
<span class="text-muted">&mdash;</span>
{% endif %}
<span class="label label-{{ powerfeed.get_status_class }}">{{ powerfeed.get_status_display }}</span>
</td>
<td>
<span class="label label-{{ powerfeed.get_type_class }}">{{ powerfeed.get_type_display }}</span>
</td>
</tr>
{% endfor %}
</table>
{% else %}
<div class="panel-body text-muted">None</div>
{% endif %}
{% if perms.dcim.add_device %}
<div class="panel-footer text-right noprint">
<a href="{% url 'dcim:device_add' %}?site={{ rack.site.pk }}&rack={{ rack.pk }}" class="btn btn-primary btn-xs">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
Add a non-racked device
</a>
</div>
{% endif %}
</div>
</div>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading">
<strong>Images</strong>
@@ -307,11 +297,52 @@
{% include 'dcim/inc/rack_elevation.html' with primary_face=front_elevation secondary_face=rear_elevation face_id=0 reserved_units=rack.get_reserved_units %}
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="rack_header">
<div class="rack_header">
<h4>Rear</h4>
</div>
{% include 'dcim/inc/rack_elevation.html' with primary_face=rear_elevation secondary_face=front_elevation face_id=1 reserved_units=rack.get_reserved_units %}
</div>
{% include 'dcim/inc/rack_elevation.html' with primary_face=rear_elevation secondary_face=front_elevation face_id=1 reserved_units=rack.get_reserved_units %}
</div>
<div class="panel panel-default">
<div class="panel-heading">
<strong>Non-Racked Devices</strong>
</div>
{% if nonracked_devices %}
<table class="table table-hover panel-body">
<tr>
<th>Name</th>
<th>Role</th>
<th>Type</th>
<th>Parent</th>
</tr>
{% for device in nonracked_devices %}
<tr{% if device.device_type.u_height %} class="warning"{% endif %}>
<td>
<a href="{% url 'dcim:device' pk=device.pk %}">{{ device }}</a>
</td>
<td>{{ device.device_role }}</td>
<td>{{ device.device_type.display_name }}</td>
<td>
{% if device.parent_bay %}
<a href="{{ device.parent_bay.device.get_absolute_url }}">{{ device.parent_bay }}</a>
{% else %}
<span class="text-muted">&mdash;</span>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% else %}
<div class="panel-body text-muted">None</div>
{% endif %}
{% if perms.dcim.add_device %}
<div class="panel-footer text-right noprint">
<a href="{% url 'dcim:device_add' %}?site={{ rack.site.pk }}&rack={{ rack.pk }}" class="btn btn-primary btn-xs">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
Add a non-racked device
</a>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}