{% extends 'generic/object.html' %} {% load lens %} {% block head %} {{ block.super }} {% include 'netbox_spatial_lens/inc/palette.html' %} {% comment %} In the head, before any module script: a browser resolves bare specifiers such as `three` only through an import map it has read before the first module loads. {% endcomment %} {% lens_import_map three_imports %} {% endblock %} {% block content %}
{% include 'netbox_spatial_lens/inc/levels.html' with site=object.site floor=floor rack=object %}
{% for o in device_overlays %} {{ o.label }} {% endfor %}
{% if elevation.devices %} {% comment %} The same control the floor has, over the same problem. Reading a name off a 48U cabinet by eye is what a room of fifty cabinets is at the other zoom. Dims the rest rather than hiding it, so a device keeps its place in the rack. {% endcomment %} {% if device_tags %} {% include 'netbox_spatial_lens/inc/finder.html' with group='device-tags' key='tags' noun='tag' label='Tags' icon='tag-outline' rows=device_tags row_template='netbox_spatial_lens/inc/finder_tag.html' %} {% endif %} {% include 'netbox_spatial_lens/inc/field_finders.html' %} {% else %} {% endif %} {% include 'netbox_spatial_lens/inc/help.html' with text='Drag to turn the rack, right-drag to move it, scroll to zoom. Click a device to show what it is cabled to. Double-click a device to open it. Click a cable to trace it. The find box matches a name or an asset tag; Tags narrows to the devices with any tag you tick. Click legend bands to filter; you can pick several. Escape clears.' %}
{% comment %} The four figures somebody walks up to a rack with. They were all on the page already, spread between a line of muted text, a badge halfway down a card, and a panel you had to select a device to open, which meant a reader wanting to know whether this cabinet had room left with none of them. {% endcomment %} {% include 'netbox_spatial_lens/inc/stats.html' with stats=stats %} {% comment %} One renderer: a Three.js scene, drawn by rack3d.js from the scene at the foot of the page. The message covers the stage until the rack is drawn, and stays with the reason when it cannot be: the drawing is turned off, there is no WebGL, or Three.js could not be loaded. The strip above and the column beside work without the drawing. {% endcomment %}
Loading the rack…
{% comment %} The allocation panel answers "what is left in this rack", and narrows to one device when one is selected. Both states are rendered up front and the script switches between them, so selecting a device costs no request. {% endcomment %} {% if device_overlay %}

{{ device_overlay.label }}

{% include 'netbox_spatial_lens/inc/legend.html' with legend=device_legend reservations=elevation.reservations filter='devices' %}
{% endif %}

Port allocation whole rack

{% for group in rack_allocation %} {% include 'netbox_spatial_lens/inc/alloc_row.html' with group=group %} {% empty %}

Nothing in this rack has any ports recorded.

{% endfor %}
{% for m in elevation.devices %} {% endfor %}
{% for band in elevation.reservations %} {% comment %} One panel per reservation, rendered up front and shown when its band is selected, the same pattern as the port allocation and the per-device cabling. Reserved space is the one thing a rack drawing can be wrong about in a way that costs money, so what it says and who claimed it should be one click away rather than three. {% endcomment %} {% endfor %}

Cabling {{ elevation.runs|length }}

{% comment %} Two ways to narrow the same list, and they compose. The legend answers "which kind of cable"; the finder answers "which of these exactly", which a rack of thirty-six rows needs as much as the map's site list did. Both are the shared controls, so a band and a tick narrow the drawing and this list without either knowing about the other. {% endcomment %} {% if elevation.runs %}
{% include 'netbox_spatial_lens/inc/finder.html' with group='cables' key='cableId' noun='cable' label='Find a cable' icon='cable-data' rows=elevation.runs row_template='netbox_spatial_lens/inc/finder_cable.html' %}
{% endif %} {% if cable_legend %} {% include 'netbox_spatial_lens/inc/legend.html' with legend=cable_legend filter='cables' %} {% endif %} {% comment %} One block per device, plus the rack-wide list. The script shows whichever matches the selection, so clicking a device narrows this card to that device rather than leaving the whole rack on screen with most of it faded. {% endcomment %} {% for mounted, runs in runs_by_device %} {% endfor %} {% comment %} What the card shows with nothing selected. It used to be every cable in the rack, which is fine at thirty-six and is a page nobody can read at four hundred. The cables are in the finder above, where they can be searched; this says so rather than leaving a card that reads as "no cabling recorded". {% endcomment %}
{% if elevation.runs %}

{{ external_runs|length }} leaving the rack, {{ internal_runs|length }} within it.

{% else %}

Nothing in this rack has a cable recorded.

{% endif %}
{% if elevation.unplaced %}

In the rack, no U recorded

{% comment %} Stated rather than hidden. A device with no position cannot be drawn, and silently leaving it out makes the elevation disagree with the rack's own device count. {% endcomment %} {% for device in elevation.unplaced %}
{{ device|linkify }} {{ device.device_type }}
{% endfor %}
{% endif %}
{{ rack3d_config|json_script:"lens-rack3d-config" }} {% endblock %}