Skip to content

Commit a0a81c2

Browse files
committed
fix: suppress partial-connection indicator on patch panel ports
FrontPort/RearPort objects never populate connected_endpoints, so the partiallyConnected check (link_peers > 0 && connected_endpoints == 0) fired on every cabled patch port — including fully-traced paths viewed from an intermediate patch panel. Guard the condition with is_port so only interface-type objects can be marked as partially connected.
1 parent dff5c4f commit a0a81c2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

netbox_device_view/templates/netbox_device_view/deviceview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
name: "{{ int.name|escapejs }}",
120120
enabled: {% if int.enabled or int.is_port %}true{% else %}false{% endif %},
121121
connected: {% if int.connected_endpoints|length > 0 or int.is_port and int.link_peers|length > 0 %}true{% else %}false{% endif %},
122-
partiallyConnected: {% if int.link_peers|length > 0 and int.connected_endpoints|length == 0 %}true{% else %}false{% endif %},
122+
partiallyConnected: {% if not int.is_port and int.link_peers|length > 0 and int.connected_endpoints|length == 0 %}true{% else %}false{% endif %},
123123
cableColor: "{% if cable_colors == 'on' and int.cable.color != '' %}{{ int.cable.color }}{% endif %}",
124124
cableNoColor: {% if cable_colors == "on" and int.cable.color == "" or cable_colors == "on" and int.cable == None %}true{% else %}false{% endif %},
125125
connectedEndpoints: [{% for ce in int.connected_endpoints %}"{{ ce.device }} | {{ ce.name }}"{% if not forloop.last %},{% endif %}{% endfor %}],

netbox_device_view/templates/netbox_device_view/ports.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h2 class="card-header">Deviceview {% if object.virtual_chassis %}{{ object.virt
116116
name: "{{ int.name|escapejs }}",
117117
enabled: {% if int.enabled or int.is_port %}true{% else %}false{% endif %},
118118
connected: {% if int.connected_endpoints|length > 0 or int.is_port and int.link_peers|length > 0 %}true{% else %}false{% endif %},
119-
partiallyConnected: {% if int.link_peers|length > 0 and int.connected_endpoints|length == 0 %}true{% else %}false{% endif %},
119+
partiallyConnected: {% if not int.is_port and int.link_peers|length > 0 and int.connected_endpoints|length == 0 %}true{% else %}false{% endif %},
120120
cableColor: "{% if cable_colors == 'on' and int.cable.color != '' %}{{ int.cable.color }}{% endif %}",
121121
cableNoColor: {% if cable_colors == "on" and int.cable.color == "" or cable_colors == "on" and int.cable == None %}true{% else %}false{% endif %},
122122
connectedEndpoints: [{% for ce in int.connected_endpoints %}"{{ ce.device }} | {{ ce.name }}"{% if not forloop.last %},{% endif %}{% endfor %}],

0 commit comments

Comments
 (0)