mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 10:16:42 -06:00
Fixed interface connection rendering
This commit is contained in:
parent
cca44d44f7
commit
47c523a40b
@ -1662,7 +1662,7 @@ class InterfaceView(View):
|
||||
interface = get_object_or_404(Interface, pk=pk)
|
||||
|
||||
# Get connected interface
|
||||
connected_interface = interface.connected_interface
|
||||
connected_interface = interface.connected_endpoint
|
||||
if connected_interface is None and hasattr(interface, 'circuit_termination'):
|
||||
peer_termination = interface.circuit_termination.get_peer_termination()
|
||||
if peer_termination is not None:
|
||||
|
@ -1,4 +1,4 @@
|
||||
<tr class="interface{% if not iface.enabled %} danger{% elif iface.connection and iface.connection.connection_status or iface.circuit_termination %} success{% elif iface.connection and not iface.connection.connection_status %} info{% elif iface.is_virtual %} warning{% endif %}" id="iface_{{ iface.name }}">
|
||||
<tr class="interface{% if not iface.enabled %} danger{% elif iface.connected_endpoint %} {% if iface.connection_status %}success{% else %}info{% endif %}{% elif iface.circuit_termination %} success{% elif iface.is_virtual %} warning{% endif %}" id="iface_{{ iface.name }}">
|
||||
|
||||
{# Checkbox #}
|
||||
{% if perms.dcim.change_interface or perms.dcim.delete_interface %}
|
||||
@ -38,8 +38,8 @@
|
||||
<td colspan="2" class="text-muted">Virtual interface</td>
|
||||
{% elif iface.is_wireless %}
|
||||
<td colspan="2" class="text-muted">Wireless interface</td>
|
||||
{% elif iface.connection %}
|
||||
{% with iface.connected_interface as connected_iface %}
|
||||
{% elif iface.connected_endpoint %}
|
||||
{% with connected_iface=iface.connected_endpoint %}
|
||||
<td>
|
||||
<a href="{% url 'dcim:device' pk=connected_iface.device.pk %}">{{ connected_iface.device }}</a>
|
||||
</td>
|
||||
|
Loading…
Reference in New Issue
Block a user