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

Merge pull request #3673 from ananace/cable-color-display

3457 Display cable colors in device interface list
This commit is contained in:
Jeremy Stretch
2019-11-06 09:53:59 -05:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@ -457,6 +457,14 @@ table.report th a {
width: 80px;
border: 1px solid grey;
}
.inline-color-block {
display: inline-block;
width: 1.5em;
height: 1.5em;
border: 1px solid grey;
border-radius: .25em;
vertical-align: middle;
}
.text-nowrap {
white-space: nowrap;
}

View File

@ -48,6 +48,9 @@
<td class="text-nowrap">
{% if iface.cable %}
<a href="{{ iface.cable.get_absolute_url }}">{{ iface.cable }}</a>
{% if iface.cable.color %}
<span class="inline-color-block" style="background-color: #{{ iface.cable.color }}">&nbsp;</span>
{% endif %}
<a href="{% url 'dcim:interface_trace' pk=iface.pk %}" class="btn btn-primary btn-xs" title="Trace">
<i class="fa fa-share-alt" aria-hidden="true"></i>
</a>