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

Introduced CableTermination abstract model to ptovide Cable access from termination points

This commit is contained in:
Jeremy Stretch
2018-10-25 15:21:16 -04:00
parent 266429101b
commit f134a6ec63
5 changed files with 68 additions and 19 deletions

View File

@@ -706,6 +706,7 @@
<th>Type</th>
<th>Rear Port</th>
<th>Position</th>
<th>Connected Cable</th>
<th></th>
</tr>
</thead>
@@ -758,6 +759,7 @@
<th>Name</th>
<th>Type</th>
<th>Positions</th>
<th>Connected Cable</th>
<th></th>
</tr>
</thead>

View File

@@ -10,6 +10,15 @@
<td>{{ frontport.get_type_display }}</td>
<td>{{ frontport.rear_port }}</td>
<td>{{ frontport.rear_port_position }}</td>
{% with cable=frontport.get_connected_cable %}
<td>
{% if cable %}
<a href="#">{{ cable }}</a> to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> <a href="{{ cable.far_end.get_absolute_url }}">{{ cable.far_end }}</a>
{% else %}
<span class="text-muted">Not connected</span>
{% endif %}
</td>
{% endwith %}
<td class="text-right">
{% if perms.dcim.change_frontport %}
<a href="{% url 'dcim:frontport_edit' pk=frontport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">

View File

@@ -9,6 +9,15 @@
</td>
<td>{{ rearport.get_type_display }}</td>
<td>{{ rearport.positions }}</td>
{% with cable=rearport.get_connected_cable %}
<td>
{% if cable %}
<a href="#">{{ cable }}</a> to <a href="{{ cable.far_end.device.get_absolute_url }}">{{ cable.far_end.device }}</a> <a href="{{ cable.far_end.get_absolute_url }}">{{ cable.far_end }}</a>
{% else %}
<span class="text-muted">Not connected</span>
{% endif %}
</td>
{% endwith %}
<td class="text-right">
{% if perms.dcim.change_rearport %}
<a href="{% url 'dcim:rearport_edit' pk=rearport.pk %}?return_url={{ device.get_absolute_url }}" title="Edit port" class="btn btn-info btn-xs">