mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 12:12:53 -06:00
Show connected circuit termination on interface view
This commit is contained in:
parent
16d8308fa8
commit
cefec1be60
@ -1286,8 +1286,8 @@ class InterfaceView(View):
|
||||
|
||||
return render(request, 'dcim/interface.html', {
|
||||
'interface': interface,
|
||||
# TODO: Also handle connected CircuitTerminations
|
||||
'connected_interface': interface._connected_interface,
|
||||
'connected_circuittermination': interface._connected_circuittermination,
|
||||
'ipaddress_table': ipaddress_table,
|
||||
'vlan_table': vlan_table,
|
||||
})
|
||||
|
@ -122,14 +122,15 @@
|
||||
{% if interface.is_connectable %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Connected Interface</strong>
|
||||
<strong>Connection</strong>
|
||||
</div>
|
||||
{% if connected_interface %}
|
||||
{% if interface.cable %}
|
||||
<table class="table table-hover panel-body attr-table">
|
||||
{% if connected_interface %}
|
||||
<tr>
|
||||
<td>{% if connected_interface.device %}Device{% else %}Virtual Machine{% endif %}</td>
|
||||
<td>Device</td>
|
||||
<td>
|
||||
<a href="{{ connected_interface.parent.get_absolute_url }}">{{ connected_interface.parent }}</a>
|
||||
<a href="{{ connected_interface.parent.get_absolute_url }}">{{ connected_interface.device }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -196,6 +197,27 @@
|
||||
<td>802.1Q Mode</td>
|
||||
<td>{{ connected_interface.get_mode_display }}</td>
|
||||
</tr>
|
||||
{% elif connected_circuittermination %}
|
||||
{% with ct=connected_circuittermination %}
|
||||
<tr>
|
||||
<td>Circuit</td>
|
||||
<td><a href="{{ ct.circuit.get_absolute_url }}">{{ ct.circuit }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Side</td>
|
||||
<td>{{ ct.term_side }}</td>
|
||||
</tr>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>Cable</td>
|
||||
<td>
|
||||
<a href="{{ interface.cable.get_absolute_url }}">{{ interface.cable }}</a>
|
||||
<a href="{% url 'dcim:interface_trace' pk=interface.pk %}" class="btn btn-primary btn-xs" title="Trace">
|
||||
<i class="fa fa-share-alt" aria-hidden="true"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Connection Status</td>
|
||||
<td>
|
||||
@ -209,31 +231,10 @@
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="panel-body text-muted">
|
||||
No connected interface
|
||||
Not connected
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<strong>Circuit Termination</strong>
|
||||
</div>
|
||||
<table class="table table-hover panel-body">
|
||||
{% if interface.circuit_termination %}
|
||||
<tr>
|
||||
<td>Circuit</td>
|
||||
<td><a href="{{ interface.circuit_termination.circuit.get_absolute_url }}">{{ interface.circuit_termination.circuit }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Side</td>
|
||||
<td>{{ interface.circuit_termination.term_side }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="2" class="text-muted">None</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if interface.is_lag %}
|
||||
<div class="panel panel-default">
|
||||
|
Loading…
Reference in New Issue
Block a user