Closes #2825: Include directly connected device for front/rear ports

This commit is contained in:
Jeremy Stretch
2019-01-31 12:21:43 -05:00
parent 6e495be835
commit 41fd4ce416
6 changed files with 46 additions and 15 deletions

View File

@@ -682,7 +682,8 @@
<th>Rear Port</th>
<th>Position</th>
<th>Description</th>
<th>Connected Cable</th>
<th>Cable</th>
<th colspan="2">Connection</th>
<th></th>
</tr>
</thead>
@@ -735,7 +736,8 @@
<th>Type</th>
<th>Positions</th>
<th>Description</th>
<th>Connected Cable</th>
<th>Cable</th>
<th colspan="2">Connection</th>
<th></th>
</tr>
</thead>

View File

@@ -23,14 +23,20 @@
{# Description #}
<td>{{ frontport.description|placeholder }}</td>
{# Cable #}
<td>
{% if frontport.cable %}
{# Cable/connection #}
{% if frontport.cable %}
<td>
<a href="{{ frontport.cable.get_absolute_url }}">{{ frontport.cable }}</a>
{% else %}
</td>
{% with far_end=frontport.get_cable_peer %}
<td><a href="{{ far_end.parent.get_absolute_url }}">{{ far_end.parent }}</a></td>
<td>{{ far_end }}</td>
{% endwith %}
{% else %}
<td colspan="3">
<span class="text-muted">Not connected</span>
{% endif %}
</td>
</td>
{% endif %}
{# Actions #}
<td class="text-right">

View File

@@ -22,14 +22,20 @@
{# Description #}
<td>{{ rearport.description|placeholder }}</td>
{# Cable #}
<td>
{% if rearport.cable %}
{# Cable/connection #}
{% if rearport.cable %}
<td>
<a href="{{ rearport.cable.get_absolute_url }}">{{ rearport.cable }}</a>
{% else %}
</td>
{% with far_end=rearport.get_cable_peer %}
<td><a href="{{ far_end.parent.get_absolute_url }}">{{ far_end.parent }}</a></td>
<td>{{ far_end }}</td>
{% endwith %}
{% else %}
<td colspan="3">
<span class="text-muted">Not connected</span>
{% endif %}
</td>
</td>
{% endif %}
{# Actions #}
<td class="text-right">