netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Rack Elevation Lazy Loading

Open tbotnz opened this issue 7 months ago • 3 comments

NetBox version

v4.3.1

Feature type

New functionality

Proposed functionality

add lazy loading to rack elevations

Use case

current solution does not scale

Database changes

No response

External dependencies

No response

tbotnz avatar May 20 '25 23:05 tbotnz

add lazy loading to rack elevations

Please add more detail about your proposed implementation.

current solution does not scale

The list is paginated and will load only a fixed number of racks per request regardless of how many have been created.

jeremystretch avatar May 22 '25 17:05 jeremystretch

@jeremystretch the pagination options can go up to 100, 1000 and users will happily pick it. This leads to requests eventually failing and unhappy users. Even with the pagination there is still 1 additional request for every rack on the page due to the use of the <object> tag, so 100 racks = 100 http requests

My implementation addresses the issue by only loading the racks as they are intersecting with the viewport, meaning only the racks on the screen are loaded (even if there are another 100+ on the page), the rest will load progressively as they are scrolled into the viewport. This means that there is a request per rack but only for the racks shown in the viewport ( as opposed to trying to load every rack on the page )

tbotnz avatar May 22 '25 20:05 tbotnz

It looks like you have a PR in for this so assigning to you @tbotnz

arthanson avatar May 29 '25 17:05 arthanson

Image Image

This commit breaks UI;

nobless avatar Sep 09 '25 23:09 nobless