Skip to content

Commit 053f49c

Browse files
Merge pull request #3673 from ananace/cable-color-display
3457 Display cable colors in device interface list
2 parents fbde618 + bbd6598 commit 053f49c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

netbox/project-static/css/base.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,14 @@ table.report th a {
457457
width: 80px;
458458
border: 1px solid grey;
459459
}
460+
.inline-color-block {
461+
display: inline-block;
462+
width: 1.5em;
463+
height: 1.5em;
464+
border: 1px solid grey;
465+
border-radius: .25em;
466+
vertical-align: middle;
467+
}
460468
.text-nowrap {
461469
white-space: nowrap;
462470
}

netbox/templates/dcim/inc/interface.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
<td class="text-nowrap">
4949
{% if iface.cable %}
5050
<a href="{{ iface.cable.get_absolute_url }}">{{ iface.cable }}</a>
51+
{% if iface.cable.color %}
52+
<span class="inline-color-block" style="background-color: #{{ iface.cable.color }}">&nbsp;</span>
53+
{% endif %}
5154
<a href="{% url 'dcim:interface_trace' pk=iface.pk %}" class="btn btn-primary btn-xs" title="Trace">
5255
<i class="fa fa-share-alt" aria-hidden="true"></i>
5356
</a>

0 commit comments

Comments
 (0)