netbox-floorplan-plugin icon indicating copy to clipboard operation
netbox-floorplan-plugin copied to clipboard

Generated URLs ignore settings.BASE_PATH

Open lc787 opened this issue 1 year ago • 3 comments

Plugin-rendered buttons href attribute ignore the BASE_PATH netbox value.

For example, given the base path internal/netbox/, the url of the button "Edit Floorplan" (in the context of /dcim/locations/{some-id}/floorplans/) should be /internal/netbox/plugins/floorplan/floorplans/1/edit/, but instead its /plugins/floorplan/floorplans/1/edit/

I suspect everything is like that, seeing as even the static stuff is broken (static/netbox_floorplan/floorplan/utils.js for example)

I can confirm that other plugins don't have this problem.

FYI I have installed everything correctly running ./manage.py collectstatic before restarting netbox[-rq]

lc787 avatar Aug 05 '24 09:08 lc787

Hello, I'm willing to file a PR to fix this properly :

  • add a bundle step for static files
  • replace hardcoded URLs in templates with url template tag

Let me know if I should

AdamBrutsaert avatar Jan 16 '25 13:01 AdamBrutsaert

@AdamBrutsaert Yes, please go ahead. We have put the making of floorplans on hold for a while, at the end of a big todo list, but we still have a use for it.

lc787 avatar Jan 19 '25 10:01 lc787

This would be a great idea, we're also affected by this issue. Otherwise great solution! 👍

KiralyCraft avatar Jan 19 '25 10:01 KiralyCraft