netbox-community / netbox-floorplan-plugin

NetBox Floorplan plugin
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Un-racked devices not listed when editing #35

Open matejv opened 2 months ago

matejv commented 2 months ago

When editing floorplan for location when I click on Un-racked devices there are no devices listed even when I have some devices under Location but not in Rack.

Looking through the code, I see there are two ajax calls here.

Using browser developer tools I see that the first URL (/plugins/floorplan/floorplans/racks/?floorplan_id=1) is called and loaded, but the second (/plugins/floorplan/floorplans/devices/?floorplan_id=1) is not called by the browser at all.

image

If I use browser developer tools to set a breakpoint to the first ajax call and then just continue execution (so just a small pause is introduced) it works - both URLs are called and shown correctly. So there might be a race condition of some kind?

Tested on:

timeu commented 3 weeks ago

This is related to this issue: https://github.com/bigskysoftware/htmx/issues/2147. Solution is to provide the source to the htmx.ajax call

ringhidb commented 2 days ago

I submitted a pull request to fix this in the plugin. #46