v0.12.0 — 10 fixed issues + real PDF backgrounds#68
Merged
Conversation
#66 Topology "Hide patch panels" toggle now uses the real Front↔Rear PortMapping (exposed via new passthrough_pairs field on each device node) instead of a fragile role-slug substring check. Properly chains edges through patch panels in series and colors the synthetic edges by the real endpoint port speeds (matching speeds → speed color, mismatch → orange warning). #62 netbox-attachments / netbox-contract (and any other plugin that uses register_model_view to add tabs) now show up on netbox-map detail pages. Root cause: urls.py used explicit path() entries without include(get_model_urls(...)), so URLs registered by other plugins were never wired up. Adding the include() at the top of urlpatterns hooks them all in. Bonus: "Add connected devices" right-click now also pulls intermediate devices on the cable trace (typically patch panels) so cables don't go missing when the far endpoint is added but the patch panel isn't. Closes #66 Closes #62
#52 Auto-suggest grid width/height from the chosen background image dimensions on the FloorPlan add/edit form (pure client-side; reads naturalWidth/height of the picked file and divides by tile_size, recomputing live when tile size changes; manual override still works). #53 Multi-site selection in Topology view — Site filter is now a multi-select that accepts both repeated ?site_id=… and the comma- separated form for backwards compatibility with saved views. #64 Filter Site Map sites by tag — new TagFilterField dropdown on the Site Map filter form, listing tags actually used on Site. #65 Site Map: load empty by default — new MapSettings boolean. Recommended for instances with thousands of sites: starts blank and only renders sites once a region/group/tenant/tag/device-role filter is applied. Closes #52 Closes #53 Closes #64 Closes #65
#61 Toolbar button to hide ports not connected within the current filtered view. Pure renderer-side filter: each device card collapses to only show ports whose remote endpoint is also visible. State persists in saved views. #54 Geocode unplaced sites from physical_address via Nominatim. New crosshair-GPS button on each unplaced-site chip in the Site Map editor; no new server-side dependency — uses the same OpenStreetMap provider already used for tiles. Handles ambiguous / missing results gracefully. #63 Three-in-one: • Switch and UPS added as built-in tile types • New Settings → Tile Types tab with TWO independent lists (Floor Plan toolbar vs Site Map create-chip tray). Fresh installs hide FTTH/fiber types by default plus floor-plan-structural types (column/wall/aisle/empty/reserved) on the Site Map. Existing tiles of hidden types still render normally — only the editor chip is hidden, so nothing breaks if a type is in use. A small +N hint appears next to the chip strip and deep-links into the settings. • Icon picker for Custom Marker Types: searches the entire MDI catalog (~7000 icons, parsed at runtime from the loaded stylesheet, zero new bytes shipped) with a live preview chip and curated quick-pick set. • Icon color option (Auto / Light / Dark) on Custom Marker Types — Auto picks light vs dark from the background luma. Honored everywhere: Site Map markers, drag ghosts, sidebar dots, Create chips, Floor Plan tiles. Plus an About tab in Settings with version, license, source/docs/issues links and a compatibility matrix. Plus a tighter floor-plan tile look (gap 2→1, radius 4→2). Plus left-sidebar menu reorganised: Maps, Catalogs, Applications (Beta), Configuration. Closes #61 Closes #54 Closes #63
Floor plans now accept PDF uploads alongside PNG / JPEG / GIF / WEBP.
PDFs are stored as-is and rendered to canvas in the browser via PDF.js
at 3x the world resolution, so they stay crisp when the user zooms in
(no blurriness from a pre-rasterized PNG).
- models: ImageField → FileField on FloorPlan.background_image so
non-image files can be uploaded
- forms: clean_background_image() validates the extension only;
bytes go straight to FileStorage with no server-side processing
- new endpoint api/pdf-dimensions/ returns the PDF page-1 natural
pixel dimensions so the grid auto-suggest can fire for PDFs the
same way it does for raster images (uses pypdfium2 — pure-Python
wheel, Apache-2.0 + BSD, no system packages)
- new form field "Auto-fill grid from background" (defaults ON for
new plans, OFF when editing) so existing grid dims aren't
silently overwritten on file change
- frontend: PDF.js (~340KB main + 1.4MB worker) lives under
static/netbox_map/js/pdfjs/ and is lazy-loaded only when the
user actually has a PDF background — plans with raster or no
background pay nothing for the feature
- floorplan_renderer.loadBackgroundImage() detects .pdf URLs and
routes them through PDF.js; the rendered offscreen canvas is
used as bgImg, so the rest of the rendering pipeline doesn't
change (drawImage works on both canvas and image sources)
- migration 0031 alters the field type (metadata-only — same
VARCHAR column underneath, existing rasters keep working
unchanged)
Closes #67
Run the test job once per NetBox minor line we claim compatibility with (currently v4.5.10 + v4.6.1). fail-fast: false so a regression on one version doesn't mask another.
ViewTestCases generate POST data from form_data; the new icon_foreground field added in this release wasn't in the fixture, so create+edit POSTs returned the form back (200) instead of redirecting on success (302).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles every accepted issue on the v0.12.0 milestone into a single release. All 10 close on merge.
Bug fixes
PortMappinginstead of a fragile role-slug substring. Properly chains edges through patch panels in series.register_model_view) now show tabs on every netbox-map detail page. Root cause:urls.pywasn't usinginclude(get_model_urls(...)).extras.managersimport wrapped in try/except so the plugin loads on NetBox 4.5.3 / 4.5.4 too. Merged separately, included here for the milestone summary.Features
api/pdf-dimensions/metadata endpoint. New opt-in checkbox (defaults on for new plans, off when editing).physical_address— crosshair-GPS button on each unplaced-site chip. Uses OSM Nominatim, no new server-side dep.SwitchandUPSas built-in tile types.Polish
Compatibility
Tested on NetBox 4.5.9 and 4.6.1 side by side.
Migrations
0024(from #49) — metadata-onlyrelated_nameon FloorPlan.tags0025site_map_load_empty0026hidden_tile_types0027backfillhidden_tile_types(skips types in use)0028hidden_tile_types_sitemap0029backfill sitemap list from floor-plan list0030CustomMarkerType.icon_foreground0031background_imageImageField → FileField (allow PDFs)All backward-compatible.
New dependency
pypdfium2>=4.0— Apache-2.0 + BSD, pure-Python wheels, no system packages. Used by theapi/pdf-dimensions/metadata endpoint.Test plan
scope_filter/supported_modelsconfigured fornetbox_map.*)rocket,medical,wallet)Closes #52
Closes #53
Closes #54
Closes #61
Closes #62
Closes #63
Closes #64
Closes #65
Closes #66
Closes #67