Skip to content

Commit

Permalink
Fixes: netbox-community#5049 - Account for chassis neighbors in lldp_…
Browse files Browse the repository at this point in the history
…neighbors template
  • Loading branch information
DanSheps committed Jan 5, 2021
1 parent e73c225 commit a9a2509
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/version-2.10.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

* [#5049](https://github.com/netbox-community/netbox/issues/5049) - Add check for LLDP neighbor chassis name to lldp_neighbors
* [#5301](https://github.com/netbox-community/netbox/issues/5301) - Fix misleading error when racking a device with invalid parameters
* [#5311](https://github.com/netbox-community/netbox/issues/5311) - Update child objects when a rack group is moved to a new site
* [#5518](https://github.com/netbox-community/netbox/issues/5518) - Fix persistent vertical scrollbar
Expand Down
7 changes: 4 additions & 3 deletions netbox/templates/dcim/device/lldp_neighbors.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<tr id="{{ iface.name }}">
<td>{{ iface }}</td>
{% if iface.connected_endpoint.device %}
<td class="configured_device" data="{{ iface.connected_endpoint.device }}">
<td class="configured_device" data="{{ iface.connected_endpoint.device }}" data-chassis="{{ iface.connected_endpoint.device.virtual_chassis.name }}">
<a href="{% url 'dcim:device' pk=iface.connected_endpoint.device.pk %}">{{ iface.connected_endpoint.device }}</a>
</td>
<td class="configured_interface" data="{{ iface.connected_endpoint }}">
Expand Down Expand Up @@ -61,6 +61,7 @@

// Glean configured hostnames/interfaces from the DOM
var configured_device = row.children('td.configured_device').attr('data');
var configured_chassis = row.children('td.configured_device').attr('data-chassis');
var configured_interface = row.children('td.configured_interface').attr('data');
var configured_interface_short = null;
if (configured_interface) {
Expand All @@ -81,9 +82,9 @@
// Apply colors to rows
if (!configured_device && lldp_device) {
row.addClass('info');
} else if (configured_device == lldp_device && configured_interface == lldp_interface) {
} else if ((configured_device == lldp_device || configured_chassis == lldp_device) && configured_interface == lldp_interface) {
row.addClass('success');
} else if (configured_device == lldp_device && configured_interface_short == lldp_interface) {
} else if ((configured_device == lldp_device || configured_chassis == lldp_device) && configured_interface_short == lldp_interface) {
row.addClass('success');
} else {
row.addClass('danger');
Expand Down

0 comments on commit a9a2509

Please sign in to comment.