Cleaned up device interfaces/IPs table

This commit is contained in:
Jeremy Stretch 2017-09-20 14:44:51 -04:00
parent e31d2c9857
commit 4f9379a5e2
2 changed files with 58 additions and 43 deletions

View File

@ -329,13 +329,14 @@ li.occupied + li.available {
}
/* Devices */
table.component-list tr.ipaddress td {
background-color: #eeffff;
padding-bottom: 4px;
padding-top: 4px;
table.component-list td.subtable {
padding: 0;
padding-left: 16px;
}
table.component-list tr.ipaddress:hover td {
background-color: #e6f7f7;
table.component-list td.subtable td {
border: none;
padding-bottom: 6px;
padding-top: 6px;
}
/* AJAX loader */

View File

@ -1,4 +1,4 @@
<tr class="interface{% if not iface.enabled %} danger{% elif iface.connection and iface.connection.connection_status %} success{% elif iface.connection and not iface.connection.connection_status %} info{% endif %}">
<tr class="interface{% if not iface.enabled %} danger{% elif iface.connection and iface.connection.connection_status or iface.circuit_termination %} success{% elif iface.connection and not iface.connection.connection_status %} info{% elif iface.is_virtual %} warning{% endif %}">
{% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %}
<td class="pk">
<input name="pk" type="checkbox" value="{{ iface.pk }}" />
@ -113,25 +113,34 @@
{% endif %}
</td>
</tr>
{% for ip in iface.ip_addresses.all %}
{% with iface.ip_addresses.all as ipaddresses %}
{% if ipaddresses %}
<tr class="ipaddress">
{% if selectable and perms.dcim.change_interface or perms.dcim.delete_interface %}
<td></td>
<td colspan="6" class="subtable">
{% else %}
<td colspan="7" class="subtable">
{% endif %}
<td colspan="3">
<table class="table table-hover">
{% for ip in ipaddresses %}
<tr>
<td>
<a href="{% url 'ipam:ipaddress' pk=ip.pk %}">{{ ip }}</a>
{% if ip.description %}
<i class="fa fa-fw fa-comment-o" title="{{ ip.description }}"></i>
{% endif %}
</td>
<td>
{% if device.primary_ip4 == ip or device.primary_ip6 == ip %}
<span class="label label-success">Primary</span>
{% endif %}
</td>
<td class="text-right">
<td>
{% if ip.vrf %}
<a href="{% url 'ipam:vrf' pk=ip.vrf.pk %}">{{ ip.vrf }}</a>
{% else %}
<span class="text-muted">Global</span>
<span class="text-muted">Global table</span>
{% endif %}
</td>
<td>
@ -150,4 +159,9 @@
{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
</table>
</td>
</tr>
{% endif %}
{% endwith %}