Commit Graph
5 Commits
Author SHA1 Message Date
MrBlakeandClaude Sonnet 5 777ded3900 Fix elevation overlap, add device images, rack merge, and size override
- Fix elevation rendering bug: device blocks were drawn MARGIN px
  further right than the rack frame/unit slots, causing them to
  overlap and extend past the right border. All three now share one
  RACK_X origin.
- Show the device type's front/rear image inside each elevation block
  (clipped to the block, translucent label bar on top for legibility)
  when one is set on the device type; falls back to a plain colour
  block with text otherwise.
- Add "Merge" action to combine two concepts into one taller one (e.g.
  two half-height racks stacked into a full-height rack): the top
  concept's devices are shifted up by the bottom concept's height,
  neither source is modified. Available from the plugin menu, from a
  concept's detail page, and via POST /concepts/merge/.
- Copying a real rack into a concept can now target a different width,
  height and/or starting unit than the source rack; devices that no
  longer fit at the chosen size are skipped and reported as warnings
  instead of aborting the copy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 09:35:18 +02:00
MrBlakeandClaude Sonnet 5 a705b64c22 Fix AssertionError on API load: PrimaryKeyRelatedField needs a real queryset
DRF's RelatedField asserts queryset is not None (unless read_only) at
__init__ time, i.e. when the class body of the Serializer is
evaluated - not when the field is later used. The previous code passed
queryset=None and tried to patch it in the serializer's own __init__,
which never ran in time because construction of the field itself
already raised. Pass the real querysets directly at class-body level
instead, matching the standard DRF/NetBox pattern; the deferred
per-instance model imports are no longer needed since serializers are
only imported once all apps are ready anyway.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 09:21:08 +02:00
MrBlakeandClaude Sonnet 5 f0d62bafd9 Fix ImportError: ButtonColorChoices lives in netbox.choices
ButtonColorChoices is defined in netbox/netbox/choices.py, not
utilities/choices.py (which only has the generic ChoiceSet base).
Cross-checked every other NetBox-internal import in the plugin against
the actual v4.6.8 source (dcim, netbox, tenancy, utilities packages)
to rule out further path mistakes; all others were already correct.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 09:18:44 +02:00
MrBlakeandClaude Sonnet 5 66a9174859 Fix ModuleNotFoundError on plugin load: use relative resource paths
PluginConfig._load_resource() prepends self.__module__ (already
'netbox_rack_concept') to the configured path, so 'menu' and
'template_extensions' must be given relative to the plugin package
('navigation.menu', 'template_content.template_extensions'), not
prefixed with 'netbox_rack_concept.' again. The prefixed form made
Django try to import 'netbox_rack_concept.netbox_rack_concept...',
which doesn't exist, crashing manage.py on every command.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 09:12:28 +02:00
MrBlakeandClaude Sonnet 5 17cf94ac0d Add netbox_rack_concept plugin: rack blueprint planning
Introduces a NetBox 4.6 plugin for planning rack layouts (RackConcept,
ConceptDevice) without creating real dcim.Rack/dcim.Device objects, so
blueprints never appear in rack/device lists, utilization reports, or
IPAM.

Features:
- Copy paths: real rack -> concept, concept -> concept (clone), and
  concept -> one or more real racks (deploy, with name patterning and
  dry-run support)
- Manual concept creation via a dedicated "Rack Concepts" nav menu
- Tenant and tenant group assignment on concepts and planned devices
- Partial-width device placement (1/1-1/4) with slot-based collision
  detection, matching netbox_utilities' partial-width feature
- Custom drag-and-drop elevation (netbox-reorder-rack operates on real
  Device querysets, which concepts don't have) with server-side
  validation of every move
- Full REST API, filtering, CSV import, bulk edit, search integration
- Optional, config-driven interop with netbox_utilities (partial-width
  field mapping) and netbox-reorder-rack, degrading gracefully when
  either plugin is absent

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-16 09:00:26 +02:00