Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect HTML ID to Aggregate Interfaces #2856

Closed
hSaria opened this issue Feb 5, 2019 · 3 comments
Closed

Incorrect HTML ID to Aggregate Interfaces #2856

hSaria opened this issue Feb 5, 2019 · 3 comments
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@hSaria
Copy link
Contributor

hSaria commented 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>
@hSaria
Copy link
Contributor Author

hSaria commented 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.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Feb 6, 2019
@jeremystretch
Copy link
Member

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.

@hSaria
Copy link
Contributor Author

hSaria commented 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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants