Incorrect HTML ID to Aggregate Interfaces #2347

Closed
opened 2025-12-29 17:25:03 +01:00 by adam · 3 comments
Owner

Originally created by @hSaria on GitHub (Feb 5, 2019).

Environment

  • Python version: 3.6.6
  • NetBox version: 2.5.5

Steps to Reproduce

  1. Create an aggregate interface (ae0 for example)
  2. Create a normal interface and configure the parent as the previous interface (ae0)
  3. On the device page, click the button on the child that reads the parent/aggregate interfaces name (ae0)

Expected Behavior

Scroll the screen to the parent/aggregate interface (ae0, in this example).

Observed Behavior

It does not move.

Solution

The link generated in the template is incorrect (uses #interface_ instead of #iface_. In templates/dcim/inc/interface.html, replace:

<a href="#interface_{{ iface.lag }}" class="label label-primary" title="{{ iface.lag.description }}">{{ iface.lag }}</a>

with

<a href="#iface_{{ iface.lag }}" class="label label-primary" title="{{ iface.lag.description }}">{{ iface.lag }}</a>
Originally created by @hSaria on GitHub (Feb 5, 2019). ### Environment * Python version: 3.6.6 * NetBox version: 2.5.5 ### Steps to Reproduce 1. Create an aggregate interface (ae0 for example) 2. Create a normal interface and configure the parent as the previous interface (ae0) 3. On the device page, click the button on the child that reads the parent/aggregate interfaces name (ae0) ### Expected Behavior Scroll the screen to the parent/aggregate interface (ae0, in this example). ### Observed Behavior It does not move. ### Solution The link generated in the template is incorrect (uses `#interface_` instead of `#iface_`. In `templates/dcim/inc/interface.html`, replace: ```python <a href="#interface_{{ iface.lag }}" class="label label-primary" title="{{ iface.lag.description }}">{{ iface.lag }}</a> ``` with ```python <a href="#iface_{{ iface.lag }}" class="label label-primary" title="{{ iface.lag.description }}">{{ iface.lag }}</a> ```
adam added the type: bugstatus: accepted labels 2025-12-29 17:25:03 +01:00
adam closed this issue 2025-12-29 17:25:03 +01:00
Author
Owner

@hSaria commented on GitHub (Feb 5, 2019):

It may be a better approach to do away with using #iface_{{ iface.lag }} and use #iface_{{ iface.lag_id }} instead, assuming it is that easy (I haven't looked any further into this). This is just to address the very rare case that there are two different LAGs with the same name on the same device.

@hSaria commented on GitHub (Feb 5, 2019): It may be a better approach to do away with using `#iface_{{ iface.lag }}` and use `#iface_{{ iface.lag_id }}` instead, assuming it is that easy (I haven't looked any further into this). This is just to address the very rare case that there are two different LAGs with the same name on the same device.
Author
Owner

@jeremystretch commented on GitHub (Feb 6, 2019):

Fixed this by changing iface to interface.

It may be a better approach to do away with using #iface_{{ iface.lag }} and use #iface_{{ iface.lag_id }} instead, assuming it is that easy (I haven't looked any further into this).

This would work too, but I prefer to use the interface name because e.g. interface_ae27 is more human-friendly than interface_38748.

@jeremystretch commented on GitHub (Feb 6, 2019): Fixed this by changing `iface` to `interface`. > It may be a better approach to do away with using `#iface_{{ iface.lag }}` and use `#iface_{{ iface.lag_id }}` instead, assuming it is that easy (I haven't looked any further into this). This would work too, but I prefer to use the interface name because e.g. `interface_ae27` is more human-friendly than `interface_38748`.
Author
Owner

@hSaria commented on GitHub (Feb 6, 2019):

Fair point. Plus, having two interfaces with the same name on the same device would be confusing already, so it's not like using the ID is gonna help in a measurable way.

@hSaria commented on GitHub (Feb 6, 2019): Fair point. Plus, having two interfaces with the same name on the same device would be confusing already, so it's not like using the ID is gonna help in a measurable way.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2347