Add images/labels toggle, clean up label styling, merge real racks

- Replace the device-image label background bar and text-shadow with
  NetBox's own technique: a black-stroke pass behind a white-fill pass
  of the same text, giving crisp readable labels over any image
  without a dark box behind them.
- Add an "Images and labels / Images only / Labels only" selector
  above the elevation, mirroring the equivalent control on real NetBox
  rack elevations. The plain label is always in the markup; the
  selector only toggles the image and its over-image label, exactly
  like core NetBox does it. Choice persists per browser via
  localStorage and works without edit permissions.
- Add a "Merge into concept" button to the real dcim Rack list: select
  two racks via the existing bulk-select checkboxes and it forwards
  them to the concept-merge page, pre-filled. New
  deploy.merge_racks_to_concept() combines two real racks' devices
  directly into one new, stacked blueprint without an intermediate
  per-rack copy step.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-16 09:50:23 +02:00
co-authored by Claude Sonnet 5
parent 777ded3900
commit e4817ea83b
13 changed files with 430 additions and 39 deletions
+11 -1
View File
@@ -10,7 +10,10 @@ def _enabled():
class RackConceptButtons(PluginTemplateExtension):
"""Adds "Copy to concept" to the button row of a rack, and lists derived concepts."""
"""
Adds "Copy to concept" to the button row of a rack, "Merge into concept" to the
rack list's toolbar, and lists concepts derived from a rack.
"""
models = ['dcim.rack']
def buttons(self):
@@ -22,6 +25,13 @@ class RackConceptButtons(PluginTemplateExtension):
'rack': self.context['object'],
})
def list_buttons(self):
if not _enabled():
return ''
if not self.context['request'].user.has_perm('netbox_rack_concept.add_rackconcept'):
return ''
return self.render('netbox_rack_concept/inc/rack_list_merge_button.html')
def right_page(self):
if not _enabled():
return ''