netbox-community / netbox-reorder-rack

NetBox plugin to allow users to reorder devices within a rack using a drag and drop UI.
Apache License 2.0
47 stars 5 forks source link

0U child devices appear as 0.5U #20

Closed llamafilm closed 4 days ago

llamafilm commented 3 months ago

netbox-reorder-rack version

v1.1.1

Python version

3.12

Steps to Reproduce

  1. Create a new rack
  2. Add a 1U device
  3. Add a 0U child device with no position
  4. Click reorder rack

Expected Behavior

Correct behavior is undefined, but it should not be possible to add a child device to the rack.

My preference: Display child devices in a separate box, and allow dragging them into a parent device. There would need to be some kind of UI indicator of parent status.

Observed Behavior

The child device is shown in the right-hand list of un-racked devices with 0.5U height. It lets me drag it into the rack. If I try to do that and save changes, it logs Internal Server Error: /api/plugins/reorder/save/176/.

Also — the unracked devices graphic is weirdly offset to the right of the page, past the extent of the top bar.

Screenshot 2024-06-25 at 4 22 31 PM
llamafilm commented 3 months ago

Why is that div is hard-coded to 434px ? https://github.com/netbox-community/netbox-reorder-rack/blob/2bc16d6cb9d4b334ab92dd4f835601a2cfd02d62/netbox_reorder_rack/templates/netbox_reorder_rack/rack.html#L83

cruse1977 commented 3 months ago

Child devices into parent is possibly beyond the scope of this plugin as we're not re-ordering rack placement; however would suggest a filter should be applied to hide child devices from being dragged into racks.

cruse1977 commented 3 months ago

This error only occurs if the child device is not installed in a parent bay.