diff --git a/netbox/project-static/css/base.css b/netbox/project-static/css/base.css index c5c7e6aa0..d85f4be2d 100644 --- a/netbox/project-static/css/base.css +++ b/netbox/project-static/css/base.css @@ -227,6 +227,42 @@ table.report th a { margin-bottom: 0; } +/* Cable tracing */ +.cable-trace { + max-width: 600px; + text-align: center; +} +.cable-trace .node { + background-color: #f0f0f0; + border: 1px solid #909090; + border-radius: 8px; + padding: 24px 16px; + position: relative; + z-index: 1; +} +.cable-trace .termination { + background-color: #f7f7f7; + border: 1px solid #909090; + border-radius: 4px; + margin: -16px auto; + padding: 12px; + position: relative; + width: 60%; + z-index: 2; +} +.cable-trace .cable { + border-left-style: solid; + border-left-width: 4px; + margin: 12px 0 12px 50%; + padding: 24px; + text-align: left; + width: 50%; +} +.cable-trace .trace-end { + margin-top: 48px; + text-align: center; +} + /* Admonition (docs) */ .admonition { margin-bottom: 10px; diff --git a/netbox/templates/dcim/cable_trace.html b/netbox/templates/dcim/cable_trace.html index 1fb580c7e..52fdbc17d 100644 --- a/netbox/templates/dcim/cable_trace.html +++ b/netbox/templates/dcim/cable_trace.html @@ -2,12 +2,12 @@ {% load helpers %} {% block header %} -

{% block title %}Cable Trace for {{ obj }}{% endblock %}

+

{% block title %}Cable Trace for {{ obj|meta:"verbose_name"|bettertitle }} {{ obj }}{% endblock %}

{% endblock %} {% block content %}
-
+
{% with traced_path=path.origin.trace %} {% for near_end, cable, far_end in traced_path %} @@ -16,7 +16,8 @@ {% 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/powerfeed.html' with powerfeed=near_end %} + {% 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 %} @@ -27,9 +28,7 @@ {# Cable #} {% if cable %} -
- {% include 'dcim/trace/cable.html' %} -
+ {% include 'dcim/trace/cable.html' %} {% endif %} {# Far end #} @@ -39,7 +38,8 @@ {% include 'dcim/trace/device.html' with device=far_end.device %} {% endif %} {% elif far_end.power_panel %} - {% include 'dcim/trace/powerfeed.html' with powerfeed=far_end %} + {% 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 %} @@ -47,15 +47,17 @@ {% endif %} {% endif %} - {% if forloop.last and far_end %} -
-
-

Trace completed!

-
Total segments: {{ traced_path|length }}
+ {% if forloop.last %} +
+ Trace completed +
Total segments: {{ traced_path|length }}
+
Total length: {% if total_length %} -
Total length: {{ total_length|floatformat:"-2" }} Meters
+ {{ total_length|floatformat:"-2" }} Meters + {% else %} + N/A {% endif %} -
+
{% endif %} diff --git a/netbox/templates/dcim/trace/cable.html b/netbox/templates/dcim/trace/cable.html index e7da2fb9e..cd1fd9398 100644 --- a/netbox/templates/dcim/trace/cable.html +++ b/netbox/templates/dcim/trace/cable.html @@ -1,15 +1,15 @@ -
-

-

+

-

{{ cable.get_status_display }}

-

{{ cable.get_type_display|default:"" }}

- {% if cable.length %}{{ cable.length }} {{ cable.get_length_unit_display }}{% endif %} - {% if cable.color %} -   +

+ {% if cable.type %} + {{ cable.get_type_display|default:"" }} + {% if cable.length %} + ({{ cable.length }} {{ cable.get_length_unit_display }}) + {% endif %} +
{% endif %} -

+ {{ cable.get_status_display }}
diff --git a/netbox/templates/dcim/trace/circuit.html b/netbox/templates/dcim/trace/circuit.html index ef1ed05bc..70e191dd2 100644 --- a/netbox/templates/dcim/trace/circuit.html +++ b/netbox/templates/dcim/trace/circuit.html @@ -1,6 +1,5 @@ -
- + diff --git a/netbox/templates/dcim/trace/device.html b/netbox/templates/dcim/trace/device.html index c3ed109d7..c3696e786 100644 --- a/netbox/templates/dcim/trace/device.html +++ b/netbox/templates/dcim/trace/device.html @@ -1,9 +1,8 @@ -
-
- Device {{ device }}
- {{ device.site }} - {% if device.rack %} - / {{ device.rack }} - {% endif %} -
+
+ {{ device }}
+ {{ device.device_type.manufacturer }} {{ device.device_type }}
+ {{ device.site }} + {% if device.rack %} + / {{ device.rack }} + {% endif %}
diff --git a/netbox/templates/dcim/trace/powerfeed.html b/netbox/templates/dcim/trace/powerfeed.html deleted file mode 100644 index a439aff27..000000000 --- a/netbox/templates/dcim/trace/powerfeed.html +++ /dev/null @@ -1,9 +0,0 @@ -
-
- Power Feed {{ powerfeed }}
- {{ powerfeed.power_panel }} - {% if powerfeed.rack %} - / {{ powerfeed.rack }} - {% endif %} -
-
diff --git a/netbox/templates/dcim/trace/powerpanel.html b/netbox/templates/dcim/trace/powerpanel.html new file mode 100644 index 000000000..f5b6230a7 --- /dev/null +++ b/netbox/templates/dcim/trace/powerpanel.html @@ -0,0 +1,5 @@ + diff --git a/netbox/templates/dcim/trace/termination.html b/netbox/templates/dcim/trace/termination.html index dedb562ea..45036ebf0 100644 --- a/netbox/templates/dcim/trace/termination.html +++ b/netbox/templates/dcim/trace/termination.html @@ -1,9 +1,8 @@ {% load helpers %} -
-
- {{ termination|meta:"verbose_name"|bettertitle }} {{ termination }} - {% if termination.type %} -
{{ termination.get_type_display }} - {% endif %} -
-
\ No newline at end of file +
+ {{ termination }}
+ {{ termination|meta:"verbose_name"|bettertitle }} + {% if termination.type %} + ({{ termination.get_type_display }}) + {% endif %} +