Different colours for "planned" and "connected" cables #3226

Closed
opened 2025-12-29 18:26:53 +01:00 by adam · 3 comments
Owner

Originally created by @candlerb on GitHub (Jan 27, 2020).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.7.2

Proposed Functionality

Currently, in cable trace view, both "Planned" and "Connected" statuses are shown in green. I would like to see a contrasting colour.

image

Use Case

Browsing cable path; identifying patch leads which have yet to be installed (or documented as installed)

Database Changes

None

External Dependencies

None

Originally created by @candlerb on GitHub (Jan 27, 2020). ### Environment * Python version: 3.5.2 * NetBox version: 2.7.2 ### Proposed Functionality Currently, in cable trace view, both "Planned" and "Connected" statuses are shown in green. I would like to see a contrasting colour. ![image](https://user-images.githubusercontent.com/44789/73218131-3aa0e200-4151-11ea-844c-7ec9fabee5ba.png) ### Use Case Browsing cable path; identifying patch leads which have yet to be installed (or documented as installed) ### Database Changes None ### External Dependencies None
adam added the type: bugstatus: accepted labels 2025-12-29 18:26:53 +01:00
adam closed this issue 2025-12-29 18:26:53 +01:00
Author
Owner

@hSaria commented on GitHub (Jan 27, 2020):

This looks like bug as the cable list (/dcim/cables/) correctly shows planned as light blue. At any rate, fixing this is pretty simple

--- a/netbox/templates/dcim/cable_trace.html
+++ b/netbox/templates/dcim/cable_trace.html
@@ -32,7 +32,7 @@
                             {% if cable.label %}<code>{{ cable.label }}</code>{% else %}Cable #{{ cable.pk }}{% endif %}
                         </a>
                     </h4>
-                    <p><span class="label label-{% if cable.status %}success{% else %}info{% endif %}">{{ cable.get_status_display }}</span></p>
+                    <p><span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span></p>
                     <p>{{ cable.get_type_display|default:"" }}</p>
                     {% if cable.length %}{{ cable.length }} {{ cable.get_length_unit_display }}{% endif %}
                     {% if cable.color %}
@hSaria commented on GitHub (Jan 27, 2020): This looks like bug as the cable list (`/dcim/cables/`) correctly shows planned as light blue. At any rate, fixing this is pretty simple ```diff --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -32,7 +32,7 @@ {% if cable.label %}<code>{{ cable.label }}</code>{% else %}Cable #{{ cable.pk }}{% endif %} </a> </h4> - <p><span class="label label-{% if cable.status %}success{% else %}info{% endif %}">{{ cable.get_status_display }}</span></p> + <p><span class="label label-{{ cable.get_status_class }}">{{ cable.get_status_display }}</span></p> <p>{{ cable.get_type_display|default:"" }}</p> {% if cable.length %}{{ cable.length }} {{ cable.get_length_unit_display }}{% endif %} {% if cable.color %} ```
Author
Owner

@jeremystretch commented on GitHub (Jan 27, 2020):

I can't wait to see how many more of these we find. 😒

@jeremystretch commented on GitHub (Jan 27, 2020): I can't wait to see how many more of these we find. :unamused:
Author
Owner

@hSaria commented on GitHub (Jan 27, 2020):

Already found a whole bunch of them on the device's interface templates. If an interface's cable is planned, the background is still green.

@hSaria commented on GitHub (Jan 27, 2020): Already found a whole bunch of them on the device's interface templates. If an interface's cable is planned, the background is still green.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3226