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

Use segment_count for segment count on trace view

This commit is contained in:
kkthxbye-code
2022-07-18 16:17:16 +02:00
parent 4bdef80554
commit 8a2276e791

View File

@ -18,43 +18,41 @@
</div> </div>
</div> </div>
<div class="trace-end"> <div class="trace-end">
{% with traced_path=path.origin.trace %} {% if path.is_split %}
{% if path.is_split %} <h3 class="text-danger">Path split!</h3>
<h3 class="text-danger">Path split!</h3> <p>Select a node below to continue:</p>
<p>Select a node below to continue:</p> <ul class="text-start">
<ul class="text-start"> {% for next_node in path.get_split_nodes %}
{% for next_node in path.get_split_nodes %} {% if next_node.cable %}
{% if next_node.cable %} <li>
<li> <a href="{% url 'dcim:frontport_trace' pk=next_node.pk %}">{{ next_node }}</a>
<a href="{% url 'dcim:frontport_trace' pk=next_node.pk %}">{{ next_node }}</a> (Cable {{ next_node.cable|linkify }})
(Cable {{ next_node.cable|linkify }}) </li>
</li> {% else %}
{% else %} <li class="text-muted">{{ next_node }}</li>
<li class="text-muted">{{ next_node }}</li> {% endif %}
{% endif %} {% endfor %}
{% endfor %} </ul>
</ul> {% else %}
{% else %} <h3 class="text-center text-success">Trace Completed</h3>
<h3 class="text-center text-success">Trace Completed</h3> <table class="table">
<table class="table"> <tr>
<tr> <th scope="row">Total segments</th>
<th scope="row">Total segments</th> <td>{{ path.segment_count }}</td>
<td>{{ traced_path|length }}</td> </tr>
</tr> <tr>
<tr> <th scope="row">Total length</th>
<th scope="row">Total length</th> <td>
<td> {% if total_length %}
{% if total_length %} {{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} Meters /
{{ total_length|floatformat:"-2" }}{% if not is_definitive %}+{% endif %} Meters / {{ total_length|meters_to_feet|floatformat:"-2" }} Feet
{{ total_length|meters_to_feet|floatformat:"-2" }} Feet {% else %}
{% else %} <span class="text-muted">N/A</span>
<span class="text-muted">N/A</span> {% endif %}
{% endif %} </td>
</td> </tr>
</tr> </table>
</table> {% endif %}
{% endif %}
{% endwith %}
</div> </div>
{% else %} {% else %}
<h3 class="text-center text-muted my-3"> <h3 class="text-center text-muted my-3">