[PR #19823] [MERGED] Closes #19550: Enhancement: Refactor rack elevations template for lazy loading /dcim/rack-elevations/ #15729

Closed
opened 2025-12-30 00:23:41 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19823
Author: @jnovinger
Created: 7/7/2025
Status: Merged
Merged: 7/8/2025
Merged by: @jeremystretch

Base: mainHead: 19550-add-rack-lazy-loading


📝 Commits (5)

  • ffacced Refactor rack elevation template to use htmx for dynamic loading and improved user experience
  • e73127b rework to prevent dup loading
  • 8ef5fbf Update netbox/templates/dcim/inc/rack_elevation.html
  • 140a186 Update netbox/templates/dcim/inc/rack_elevation.html
  • 7874d3f Move inline styles to styles/custom/racks.css

📊 Changes

4 files changed (+18 additions, -2 deletions)

View changed files

📝 netbox/project-static/dist/netbox.css (+1 -1)
netbox/project-static/styles/custom/racks.scss (+4 -0)
📝 netbox/project-static/styles/netbox.scss (+1 -0)
📝 netbox/templates/dcim/inc/rack_elevation.html (+12 -1)

📄 Description

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

Note:

This PR replaces #19549.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19823 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 7/7/2025 **Status:** ✅ Merged **Merged:** 7/8/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `19550-add-rack-lazy-loading` --- ### 📝 Commits (5) - [`ffacced`](https://github.com/netbox-community/netbox/commit/ffacced2b18d30509b60ddaa1423d689c5cde1e0) Refactor rack elevation template to use htmx for dynamic loading and improved user experience - [`e73127b`](https://github.com/netbox-community/netbox/commit/e73127b390c5dd5e4e58c98ec50a5eb0d0c3486a) rework to prevent dup loading - [`8ef5fbf`](https://github.com/netbox-community/netbox/commit/8ef5fbf1826852ad609d9930291985569c8f0d14) Update netbox/templates/dcim/inc/rack_elevation.html - [`140a186`](https://github.com/netbox-community/netbox/commit/140a18603f49ba3bc8d2e8f9e79c4b2b603161d3) Update netbox/templates/dcim/inc/rack_elevation.html - [`7874d3f`](https://github.com/netbox-community/netbox/commit/7874d3f1252add0806fb13b193180bb171321dde) Move inline styles to styles/custom/racks.css ### 📊 Changes **4 files changed** (+18 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/project-static/dist/netbox.css` (+1 -1) ➕ `netbox/project-static/styles/custom/racks.scss` (+4 -0) 📝 `netbox/project-static/styles/netbox.scss` (+1 -0) 📝 `netbox/templates/dcim/inc/rack_elevation.html` (+12 -1) </details> ### 📄 Description ### 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 #### Note: This PR replaces #19549. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:23:41 +01:00
adam closed this issue 2025-12-30 00:23:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15729