netbox-map 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. netbox_map-0.1.0/LICENSE +190 -0
  2. netbox_map-0.1.0/MANIFEST.in +2 -0
  3. netbox_map-0.1.0/PKG-INFO +418 -0
  4. netbox_map-0.1.0/README.md +400 -0
  5. netbox_map-0.1.0/netbox_map/__init__.py +23 -0
  6. netbox_map-0.1.0/netbox_map/api/__init__.py +0 -0
  7. netbox_map-0.1.0/netbox_map/api/serializers.py +115 -0
  8. netbox_map-0.1.0/netbox_map/api/urls.py +10 -0
  9. netbox_map-0.1.0/netbox_map/api/views.py +30 -0
  10. netbox_map-0.1.0/netbox_map/choices.py +44 -0
  11. netbox_map-0.1.0/netbox_map/filtersets.py +90 -0
  12. netbox_map-0.1.0/netbox_map/forms.py +449 -0
  13. netbox_map-0.1.0/netbox_map/migrations/0001_initial.py +133 -0
  14. netbox_map-0.1.0/netbox_map/migrations/0002_rename_netbox_map_assigne_idx_netbox_map__assigne_eb5b30_idx.py +18 -0
  15. netbox_map-0.1.0/netbox_map/migrations/0003_floorplantile_latitude_longitude_locationcoordinates.py +76 -0
  16. netbox_map-0.1.0/netbox_map/migrations/0004_mapmarker.py +125 -0
  17. netbox_map-0.1.0/netbox_map/migrations/0005_rename_netbox_map__assigne_mapmarker_idx_netbox_map__assigne_6fd3ec_idx.py +18 -0
  18. netbox_map-0.1.0/netbox_map/migrations/0006_mapsettings.py +28 -0
  19. netbox_map-0.1.0/netbox_map/migrations/0007_alter_mapsettings_id.py +18 -0
  20. netbox_map-0.1.0/netbox_map/migrations/__init__.py +0 -0
  21. netbox_map-0.1.0/netbox_map/models.py +464 -0
  22. netbox_map-0.1.0/netbox_map/navigation.py +67 -0
  23. netbox_map-0.1.0/netbox_map/search.py +29 -0
  24. netbox_map-0.1.0/netbox_map/signals.py +150 -0
  25. netbox_map-0.1.0/netbox_map/static/netbox_map/css/floorplan.css +706 -0
  26. netbox_map-0.1.0/netbox_map/static/netbox_map/css/leaflet-1.9.4.min.css +661 -0
  27. netbox_map-0.1.0/netbox_map/static/netbox_map/css/site_map.css +434 -0
  28. netbox_map-0.1.0/netbox_map/static/netbox_map/js/floorplan_editor.js +644 -0
  29. netbox_map-0.1.0/netbox_map/static/netbox_map/js/floorplan_viewer.js +1713 -0
  30. netbox_map-0.1.0/netbox_map/static/netbox_map/js/jspdf.umd.min.js +398 -0
  31. netbox_map-0.1.0/netbox_map/static/netbox_map/js/leaflet-1.9.4.min.js +6 -0
  32. netbox_map-0.1.0/netbox_map/static/netbox_map/js/site_map.js +1354 -0
  33. netbox_map-0.1.0/netbox_map/tables.py +135 -0
  34. netbox_map-0.1.0/netbox_map/template_content.py +41 -0
  35. netbox_map-0.1.0/netbox_map/templates/netbox_map/device_map_locations.html +62 -0
  36. netbox_map-0.1.0/netbox_map/templates/netbox_map/floorplan.html +74 -0
  37. netbox_map-0.1.0/netbox_map/templates/netbox_map/floorplan_visualization.html +560 -0
  38. netbox_map-0.1.0/netbox_map/templates/netbox_map/floorplantile.html +65 -0
  39. netbox_map-0.1.0/netbox_map/templates/netbox_map/inc/device_floorplan_panel.html +25 -0
  40. netbox_map-0.1.0/netbox_map/templates/netbox_map/inc/site_floorplan_panel.html +28 -0
  41. netbox_map-0.1.0/netbox_map/templates/netbox_map/mapmarker.html +82 -0
  42. netbox_map-0.1.0/netbox_map/templates/netbox_map/settings.html +135 -0
  43. netbox_map-0.1.0/netbox_map/templates/netbox_map/site_map.html +121 -0
  44. netbox_map-0.1.0/netbox_map/urls.py +43 -0
  45. netbox_map-0.1.0/netbox_map/views.py +586 -0
  46. netbox_map-0.1.0/netbox_map.egg-info/PKG-INFO +418 -0
  47. netbox_map-0.1.0/netbox_map.egg-info/SOURCES.txt +49 -0
  48. netbox_map-0.1.0/netbox_map.egg-info/dependency_links.txt +1 -0
  49. netbox_map-0.1.0/netbox_map.egg-info/top_level.txt +1 -0
  50. netbox_map-0.1.0/pyproject.toml +36 -0
  51. netbox_map-0.1.0/setup.cfg +4 -0
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 Christian Rose
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ recursive-include netbox_map/templates *
2
+ recursive-include netbox_map/static *
@@ -0,0 +1,418 @@
1
+ Metadata-Version: 2.4
2
+ Name: netbox-map
3
+ Version: 0.1.0
4
+ Summary: Interactive floor plan visualization for NetBox sites
5
+ Author: Christian Rose
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/DenDanskeMine/netbox-map
8
+ Project-URL: Repository, https://github.com/DenDanskeMine/netbox-map
9
+ Project-URL: Issues, https://github.com/DenDanskeMine/netbox-map/issues
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: Django
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.12
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Dynamic: license-file
18
+
19
+ # NetBox Map
20
+
21
+ ![Python](https://img.shields.io/badge/python-3.12%2B-blue.svg)
22
+ ![NetBox](https://img.shields.io/badge/netbox-4.5%2B-blue.svg)
23
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
24
+ [![PyPI](https://img.shields.io/pypi/v/netbox-map.svg)](https://pypi.org/project/netbox-map/)
25
+
26
+ A comprehensive mapping and floor plan visualization plugin for NetBox. Build interactive data center floor plans, place assets on a global geographic map, visualize rack utilization, explore devices nested inside racks, and configure everything from a web-based settings page — no restart required.
27
+
28
+ ---
29
+
30
+ ## Feature Highlights
31
+
32
+ | Feature | Description |
33
+ |---------|-------------|
34
+ | **Interactive Floor Plans** | Canvas-based editor with drag-and-drop tile placement, pan/zoom, and configurable grids |
35
+ | **Global Site Map** | Leaflet.js geographic map showing sites, locations, tiles, and standalone markers |
36
+ | **Rack Utilization Heatmap** | Color-coded gradient (green → red) showing rack fill percentage directly on tiles |
37
+ | **Nested Rack Devices** | Expand any rack in the sidebar to see all devices inside it, sorted by U-position |
38
+ | **Searchable Sidebar** | Real-time search across tile labels, device names, and IP addresses — finds devices inside racks |
39
+ | **Rack Elevation View** | Select a rack tile to see its full front/rear elevation SVG in the sidebar |
40
+ | **Camera FOV Visualization** | Configure and display camera field-of-view cones with live preview |
41
+ | **GPS Sync** | Automatically updates device latitude/longitude when placed on a map |
42
+ | **Web-Based Settings** | Toggle features and configure detail panel fields from the UI — no file editing or restarts |
43
+ | **PDF Export** | One-click export of floor plans to PDF |
44
+ | **REST API** | Full CRUD API for all models with filtering and search |
45
+ | **Dark Mode** | Full support for NetBox light and dark themes |
46
+
47
+ ---
48
+
49
+ ## Table of Contents
50
+
51
+ - [Requirements](#requirements)
52
+ - [Installation](#installation)
53
+ - [Floor Plan Visualization](#floor-plan-visualization)
54
+ - [Canvas Editor](#canvas-editor)
55
+ - [Tile Types](#tile-types)
56
+ - [Object Linking](#object-linking)
57
+ - [Rack Utilization](#rack-utilization)
58
+ - [Nested Rack Devices](#nested-rack-devices)
59
+ - [Rack Elevation](#rack-elevation)
60
+ - [Camera FOV](#camera-fov)
61
+ - [Sidebar Search & Filtering](#sidebar-search--filtering)
62
+ - [PDF Export](#pdf-export)
63
+ - [Global Site Map](#global-site-map)
64
+ - [Map Markers](#map-markers)
65
+ - [Edit Mode](#site-map-edit-mode)
66
+ - [Settings](#settings)
67
+ - [Detail Panel Configuration](#detail-panel-configuration)
68
+ - [GPS Sync Toggle](#gps-sync-toggle)
69
+ - [NetBox Integration](#netbox-integration)
70
+ - [REST API](#rest-api)
71
+ - [Controls Reference](#controls-reference)
72
+ - [Development](#development)
73
+ - [License](#license)
74
+
75
+ ---
76
+
77
+ ## Requirements
78
+
79
+ - NetBox **4.5.0** or later
80
+ - Python **3.12** or later
81
+
82
+ ## Installation
83
+
84
+ ### From PyPI
85
+
86
+ ```bash
87
+ source /opt/netbox/venv/bin/activate
88
+ pip install netbox-map
89
+ ```
90
+
91
+ ### From source
92
+
93
+ ```bash
94
+ source /opt/netbox/venv/bin/activate
95
+ pip install git+https://github.com/DenDanskeMine/netbox-map.git
96
+ ```
97
+
98
+ ### Enable the plugin
99
+
100
+ Add `netbox_map` to your NetBox `configuration.py`:
101
+
102
+ ```python
103
+ PLUGINS = [
104
+ 'netbox_map',
105
+ ]
106
+ ```
107
+
108
+ ### Optional configuration
109
+
110
+ ```python
111
+ PLUGINS_CONFIG = {
112
+ 'netbox_map': {
113
+ 'default_grid_width': 20, # Default grid width in tiles
114
+ 'default_grid_height': 20, # Default grid height in tiles
115
+ 'default_tile_size': 60, # Default tile size in pixels
116
+ }
117
+ }
118
+ ```
119
+
120
+ > All other settings (detail panel fields, MAC display, GPS sync) are managed from the web-based [Settings](#settings) page.
121
+
122
+ ### Apply migrations
123
+
124
+ ```bash
125
+ cd /opt/netbox/netbox
126
+ python3 manage.py migrate
127
+ ```
128
+
129
+ ### Collect static files
130
+
131
+ ```bash
132
+ cd /opt/netbox/netbox
133
+ python3 manage.py collectstatic --no-input
134
+ ```
135
+
136
+ ### Restart services
137
+
138
+ ```bash
139
+ sudo systemctl restart netbox
140
+ ```
141
+
142
+ ---
143
+
144
+ ## Floor Plan Visualization
145
+
146
+ ### Canvas Editor
147
+
148
+ The floor plan editor is a full-featured canvas application with:
149
+
150
+ - **Configurable grid** — set width, height (up to 1000 cells), and tile size (5–200px)
151
+ - **Pan and zoom** — mouse wheel zoom, middle-click or left-click drag to pan
152
+ - **Fit to view** — one click to auto-fit all tiles in the viewport
153
+ - **Background images** — upload blueprints or photos as placement guides
154
+ - **Floor plan selector** — switch between floor plans at the same site without leaving the page
155
+
156
+ **To create a floor plan:**
157
+
158
+ 1. Navigate to **Floor Plans > Floor Plans > Add**
159
+ 2. Select a site, name the floor plan, and configure grid dimensions
160
+ 3. Optionally upload a background image
161
+ 4. Open the **Visualization** tab to start editing
162
+
163
+ **Edit mode controls:**
164
+
165
+ - **Double-click** on the grid to place a new tile
166
+ - **Drag** a tile to move it (auto-saves position)
167
+ - **Click** a tile to select it and view details in the sidebar
168
+ - Use the toolbar to set tile type, label, and dimensions before placing
169
+ - **Delete** selected tiles with the delete button
170
+
171
+ ### Tile Types
172
+
173
+ 12 tile types are available, each with a distinct color:
174
+
175
+ | Type | Color | Use Case |
176
+ |------|-------|----------|
177
+ | Rack | Utilization gradient | Server racks with fill percentage |
178
+ | Aisle | Dark grey | Walkways between rack rows |
179
+ | Wall | Medium grey | Room boundaries |
180
+ | Column | Light grey | Structural columns |
181
+ | Door | Teal | Entry/exit points |
182
+ | Cooling | Cyan | CRAC/CRAH units, in-row cooling |
183
+ | Power | Gold | PDUs, UPS, electrical panels |
184
+ | Empty | Dark | Placeholder / available space |
185
+ | Reserved | Orange | Reserved for future use |
186
+ | Access Point | Purple | Wireless access points |
187
+ | Camera | Red | Security cameras (with FOV) |
188
+ | Printer | Orange | Network printers |
189
+
190
+ Each tile supports:
191
+ - **Custom labels** (editable inline)
192
+ - **Size** from 1x1 to 10x10 grid cells
193
+ - **Status** — Active, Planned, or Decommissioned
194
+ - **Orientation** — 0, 90, 180, 270 degrees
195
+
196
+ ### Object Linking
197
+
198
+ Tiles can be linked to NetBox objects:
199
+
200
+ - **Racks** — shows utilization, elevation, and nested devices
201
+ - **Devices** — shows primary IP, MAC address, and detail fields
202
+ - **Power Panels** — shows site and location info
203
+ - **Power Feeds** — shows status, voltage, amperage
204
+
205
+ **To link an object:**
206
+
207
+ 1. Enter edit mode and select a tile
208
+ 2. In the **Link Object** panel, choose an object type
209
+ 3. Select the specific object from the dropdown (filtered by site)
210
+ 4. Click **Link**
211
+
212
+ ### Rack Utilization
213
+
214
+ Rack tiles display a color-coded utilization heatmap:
215
+
216
+ - **Green** (0%) → **Yellow** (50%) → **Red** (90%+)
217
+ - Empty/unlinked racks show as neutral grey
218
+ - Utilization percentage is displayed on the tile when there's enough space
219
+ - The gradient legend appears in the header bar
220
+
221
+ ### Nested Rack Devices
222
+
223
+ Every rack tile in the sidebar shows an **expand arrow** (▸) when it contains devices:
224
+
225
+ - Click the arrow to expand and see all devices in that rack
226
+ - Devices are sorted by **U-position** (highest first)
227
+ - Each device shows its **name** (linked to NetBox), **IP address**, and **U-position**
228
+ - A device count badge (e.g., "12d") appears on each rack item
229
+ - **Searching works across devices** — type a device name or IP in the search box and the parent rack auto-expands to reveal matching devices
230
+ - Device data is fetched once via a single API call and cached for the session
231
+
232
+ ### Rack Elevation
233
+
234
+ When a rack tile is selected, the sidebar shows the rack's **elevation SVG**:
235
+
236
+ - Toggle between **Front** and **Rear** views
237
+ - Shows device positions, model names, and empty slots
238
+ - Click devices in the elevation to navigate to their detail pages
239
+ - Loaded via AJAX from NetBox's rack elevation API
240
+
241
+ ### Camera FOV
242
+
243
+ Camera-type tiles display a field-of-view cone on the canvas:
244
+
245
+ - **Direction** (0–360 degrees) — where the camera points (0 = north)
246
+ - **Angle** (10–360 degrees) — how wide the FOV is
247
+ - **Distance** (1–50 grid cells) — how far the camera sees
248
+ - FOV cones render as semi-transparent red wedges
249
+ - **Live preview** — adjust values and see the cone update in real-time
250
+ - Toggle all FOV cones on/off with the **FOV** button in the sidebar
251
+
252
+ ### Sidebar Search & Filtering
253
+
254
+ The sidebar provides powerful search and filtering:
255
+
256
+ - **Real-time text search** — filters tiles by label, type, device name, and IP address
257
+ - **Type toggles** — show/hide any of the 12 tile types independently
258
+ - **Tile count** — shows visible / total tile count
259
+ - **Click to zoom** — clicking a sidebar item zooms the canvas to center that tile
260
+ - **Active highlighting** — selected tile is highlighted in both the sidebar and canvas
261
+
262
+ ### PDF Export
263
+
264
+ Click the **PDF** button in the zoom controls to export the current floor plan:
265
+
266
+ - Includes all visible tiles with correct colors and labels
267
+ - Respects type toggle visibility (hidden types are excluded)
268
+ - Adds a title header and tile count legend
269
+ - Camera FOV cones are included if the FOV toggle is on
270
+
271
+ ---
272
+
273
+ ## Global Site Map
274
+
275
+ The site map provides a geographic overview of your entire infrastructure using **Leaflet.js** with OpenStreetMap tiles.
276
+
277
+ Navigate to **Floor Plans > Maps > Site Map**.
278
+
279
+ ### What's on the map
280
+
281
+ - **Sites** — with floor plan links in popups
282
+ - **Locations** — via the LocationCoordinates model (extends NetBox locations with lat/lng)
283
+ - **Floor plan tiles** — tiles with geographic coordinates appear on the global map
284
+ - **Standalone map markers** — custom markers not tied to floor plans
285
+
286
+ ### Map Markers
287
+
288
+ Standalone map markers can be placed anywhere on the globe:
289
+
290
+ - All 12 marker types supported (same as tile types)
291
+ - Can be linked to devices, racks, power panels, or power feeds
292
+ - Optional site association
293
+ - Description field
294
+ - Camera markers include full FOV visualization on the map
295
+
296
+ ### Site Map Edit Mode
297
+
298
+ Users with `change_site` permission can enter edit mode:
299
+
300
+ - **Place sites** — select an unplaced site and click the map to set its coordinates
301
+ - **Place locations** — add geographic coordinates to NetBox locations
302
+ - **Place tiles** — give floor plan tiles a geographic position
303
+ - **Add markers** — create new standalone map markers by clicking the map
304
+ - **Drag to reposition** — all markers are draggable in edit mode (auto-saves)
305
+ - **Remove/delete** — remove tiles from the map or delete standalone markers
306
+
307
+ ---
308
+
309
+ ## Settings
310
+
311
+ Navigate to **Floor Plans > Configuration > Settings** to manage plugin settings from the web UI.
312
+
313
+ ### Detail Panel Configuration
314
+
315
+ Control which fields appear in the detail panel when you click a tile or marker:
316
+
317
+ **General toggles:**
318
+ - **Show MAC Address** — display MAC address for devices (from primary IP interface)
319
+ - **Show Custom Fields** — display custom fields in the detail panel
320
+
321
+ **Per-object-type field selection:**
322
+
323
+ Select which standard fields to show for each object type using checkboxes:
324
+
325
+ | Object Type | Available Fields |
326
+ |-------------|-----------------|
327
+ | **Device** | status, role, device_type, platform, serial, asset_tag, tenant, site, location, rack, position, face, airflow, primary_ip4, primary_ip6, oob_ip, cluster, virtual_chassis, vc_position, description |
328
+ | **Rack** | status, role, facility_id, serial, asset_tag, u_height, width, type, weight, max_weight, tenant, site, location, description |
329
+ | **Power Panel** | site, location, description |
330
+ | **Power Feed** | status, type, supply, voltage, amperage, max_utilization, power_panel, rack, description |
331
+
332
+ ### GPS Sync Toggle
333
+
334
+ - **Sync Device GPS** — when enabled, placing a device on a map (via tile or marker with coordinates) automatically writes the latitude/longitude to the device record in NetBox
335
+ - When a tile/marker is deleted or the device is unlinked, the GPS is cleared if no other map references remain
336
+
337
+ All settings are stored in the database and take effect immediately — no restart needed.
338
+
339
+ ---
340
+
341
+ ## NetBox Integration
342
+
343
+ The plugin integrates with existing NetBox pages:
344
+
345
+ | Integration | Description |
346
+ |-------------|-------------|
347
+ | **Site detail page** | Panel showing floor plans for the site with links to visualizations |
348
+ | **Device detail page** | "Map Locations" tab listing all floor plan tiles and map markers where the device appears |
349
+ | **Global search** | Floor plans, tiles, and map markers are indexed for NetBox search |
350
+ | **Change logging** | All models support NetBox's change log |
351
+
352
+ ---
353
+
354
+ ## REST API
355
+
356
+ Full CRUD REST API endpoints:
357
+
358
+ | Endpoint | Description |
359
+ |----------|-------------|
360
+ | `/api/plugins/netbox-map/floorplans/` | Floor plan CRUD with site/location filtering |
361
+ | `/api/plugins/netbox-map/floorplan-tiles/` | Tile CRUD with floor plan, type, status filtering |
362
+ | `/api/plugins/netbox-map/location-coordinates/` | Geographic coordinates for locations |
363
+ | `/api/plugins/netbox-map/map-markers/` | Standalone map marker CRUD |
364
+
365
+ All endpoints support filtering, pagination, and brief mode.
366
+
367
+ ---
368
+
369
+ ## Controls Reference
370
+
371
+ ### Floor Plan Canvas
372
+
373
+ | Action | Control |
374
+ |--------|---------|
375
+ | Pan | Left-click drag (empty space) or middle-click drag |
376
+ | Zoom | Mouse wheel or +/- buttons |
377
+ | Fit to view | Fit button in zoom controls |
378
+ | Select tile | Click |
379
+ | Place tile (edit mode) | Double-click |
380
+ | Move tile (edit mode) | Drag tile |
381
+
382
+ ### Site Map
383
+
384
+ | Action | Control |
385
+ |--------|---------|
386
+ | Pan | Left-click drag |
387
+ | Zoom | Mouse wheel or +/- buttons |
388
+ | Select marker | Click |
389
+ | Move marker (edit mode) | Drag |
390
+ | Place item (edit mode) | Select item, click map |
391
+
392
+ ### Sidebar
393
+
394
+ | Action | Control |
395
+ |--------|---------|
396
+ | Search | Type in the search box |
397
+ | Filter by type | Click type toggle buttons |
398
+ | Zoom to tile | Click sidebar item |
399
+ | Expand rack devices | Click the arrow (▸) on a rack item |
400
+
401
+ ---
402
+
403
+ ## Development
404
+
405
+ ```bash
406
+ git clone https://github.com/DenDanskeMine/netbox-map.git
407
+ cd netbox-map
408
+ pip install -e .
409
+ ```
410
+
411
+ ## License
412
+
413
+ This project is licensed under the Apache License 2.0 — see the [LICENSE](LICENSE) file for details.
414
+
415
+ ## Support
416
+
417
+ - [Open an issue](https://github.com/DenDanskeMine/netbox-map/issues) on GitHub
418
+ - Check existing issues for answers