Skip to content

#19550 Enhancement: Refactor rack elevations template for lazy loading /dcim/rack-elevations/ #19549

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tbotnz
Copy link

@tbotnz tbotnz commented May 20, 2025

Closes: #19550

The existing rack elevations template does not scale well, for e.g if the user has the pagination set 1000, the rack elevation template will try and make a rack http call for every rack when the page loads (#19550)

this PR does the following

  • introduce lazy loading so that racks are only loaded once they intersect with the viewport
  • spinner added to show while racks are being lazy loaded

@tbotnz tbotnz changed the title Refactor rack elevations template for lazy loading /dcim/rack-elevations/ #19550 Enhancement: Refactor rack elevations template for lazy loading /dcim/rack-elevations/ May 20, 2025
@jeremystretch jeremystretch self-requested a review June 3, 2025 12:34
@jeremystretch jeremystretch changed the base branch from develop to main June 3, 2025 12:38
hx-swap="outerHTML"
aria-label="{% trans 'Rack elevation' %}"
>
<div class="d-flex justify-content-center align-items-center" style="min-height: 200px; margin-left: 30px;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inline styles are generally not permitted. If these attributes are necessary, they should be declared under a class in the source Sass.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 2 of the template begs to differ, however point taken

tbotnz and others added 2 commits June 9, 2025 13:56
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants