diff --git a/netbox/project-static/css/base.css b/netbox/project-static/css/base.css index d85f4be2d..7d889e32a 100644 --- a/netbox/project-static/css/base.css +++ b/netbox/project-static/css/base.css @@ -230,6 +230,7 @@ table.report th a { /* Cable tracing */ .cable-trace { max-width: 600px; + margin: 16px auto; text-align: center; } .cable-trace .node { diff --git a/netbox/templates/dcim/cable_trace.html b/netbox/templates/dcim/cable_trace.html index 52fdbc17d..da56e48c1 100644 --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -7,76 +7,106 @@ {% block content %}
-
- {% with traced_path=path.origin.trace %} - {% for near_end, cable, far_end in traced_path %} +
+
+ {% with traced_path=path.origin.trace %} + {% for near_end, cable, far_end in traced_path %} - {# Near end #} - {% if near_end.device %} - {% include 'dcim/trace/device.html' with device=near_end.device %} - {% include 'dcim/trace/termination.html' with termination=near_end %} - {% elif near_end.power_panel %} - {% include 'dcim/trace/powerpanel.html' with powerpanel=near_end.power_panel %} - {% include 'dcim/trace/termination.html' with termination=far_end%} - {% elif near_end.circuit %} - {% include 'dcim/trace/circuit.html' with circuit=near_end.circuit %} - {% include 'dcim/trace/termination.html' with termination=near_end %} - {% else %} -

Split Paths!

- {# TODO: Present the user with successive paths to choose from #} - {% endif %} - - {# Cable #} - {% if cable %} - {% include 'dcim/trace/cable.html' %} - {% endif %} - - {# Far end #} - {% if far_end.device %} - {% include 'dcim/trace/termination.html' with termination=far_end %} - {% if forloop.last %} - {% include 'dcim/trace/device.html' with device=far_end.device %} + {# Near end #} + {% if near_end.device %} + {% include 'dcim/trace/device.html' with device=near_end.device %} + {% include 'dcim/trace/termination.html' with termination=near_end %} + {% elif near_end.power_panel %} + {% include 'dcim/trace/powerpanel.html' with powerpanel=near_end.power_panel %} + {% include 'dcim/trace/termination.html' with termination=far_end%} + {% elif near_end.circuit %} + {% include 'dcim/trace/circuit.html' with circuit=near_end.circuit %} + {% include 'dcim/trace/termination.html' with termination=near_end %} + {% else %} +

Split Paths!

+ {# TODO: Present the user with successive paths to choose from #} {% endif %} - {% elif far_end.power_panel %} - {% include 'dcim/trace/termination.html' with termination=far_end %} - {% include 'dcim/trace/powerpanel.html' with powerpanel=far_end.power_panel %} - {% elif far_end.circuit %} - {% include 'dcim/trace/termination.html' with termination=far_end %} - {% if forloop.last %} - {% include 'dcim/trace/circuit.html' with circuit=far_end.circuit %} + + {# Cable #} + {% if cable %} + {% include 'dcim/trace/cable.html' %} {% endif %} - {% endif %} - {% if forloop.last %} -
- Trace completed -
Total segments: {{ traced_path|length }}
-
Total length: - {% if total_length %} - {{ total_length|floatformat:"-2" }} Meters - {% else %} - N/A - {% endif %} -
-
- {% endif %} + {# Far end #} + {% if far_end.device %} + {% include 'dcim/trace/termination.html' with termination=far_end %} + {% if forloop.last %} + {% include 'dcim/trace/device.html' with device=far_end.device %} + {% endif %} + {% elif far_end.power_panel %} + {% include 'dcim/trace/termination.html' with termination=far_end %} + {% include 'dcim/trace/powerpanel.html' with powerpanel=far_end.power_panel %} + {% elif far_end.circuit %} + {% include 'dcim/trace/termination.html' with termination=far_end %} + {% if forloop.last %} + {% include 'dcim/trace/circuit.html' with circuit=far_end.circuit %} + {% endif %} + {% endif %} - {% endfor %} - {% endwith %} + {% if forloop.last %} +
+ Trace completed +
Total segments: {{ traced_path|length }}
+
Total length: + {% if total_length %} + {{ total_length|floatformat:"-2" }} Meters + {% else %} + N/A + {% endif %} +
+
+ {% endif %} + + {% endfor %} + {% endwith %} +
-

Related Paths

- +
+
+ Related Paths +
+ + + + + + + + + + {% for cablepath in related_paths %} + + + + + + {% empty %} + + {% endfor %} + +
OriginDestinationSegments
+ + {{ cablepath.origin.parent }} / {{ cablepath.origin }} + + + {% if cablepath.destination %} + {{ cablepath.destination }} ({{ cablepath.destination.parent }}) + {% else %} + Incomplete + {% endif %} + + {{ cablepath.segment_count }} +
+ None found +
+