{% extends 'generic/object.html' %} {% load static %} {% load lens %} {% load helpers %} {% 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.effective_site floor=object %} {% if placed_racks %}
{% endif %}
{% for o in overlays %} {{ o.label }} {% endfor %}
{% comment %} A toggle rather than an overlay: the runs are drawn over whatever colouring is already chosen, and asking somebody to give up the power view to see the cabling would make the two facts impossible to read together. {% endcomment %} Cable runs {% if placed_racks %} {% comment %} Finding one cabinet in a room of fifty is the commonest thing anybody does here and there was no way to do it but to read every label. Filters as you type, and dims the rest rather than hiding it, so a rack keeps its place in the room. {% endcomment %} {% if rack_tags %} {% include 'netbox_spatial_lens/inc/finder.html' with group='rack-tags' key='tags' noun='tag' label='Tags' icon='tag-outline' rows=rack_tags row_template='netbox_spatial_lens/inc/finder_tag.html' %} {% endif %} {% include 'netbox_spatial_lens/inc/field_finders.html' %} {% include 'netbox_spatial_lens/inc/help.html' with text='Click a rack to go inside it. Hover a rack to see its detail. In 3D, drag to turn the room, right-drag to move it, scroll to zoom. In 2D, Ctrl + wheel zooms and dragging moves the plan when zoomed. The find box matches a name or an asset tag; Tags narrows to the racks with any tag you tick. Click legend bands to filter; you can pick several. Escape clears.' %} {% endif %}
{% if placed_racks %} {% include 'netbox_spatial_lens/inc/stats.html' with stats=stats %} {% comment %} The room in 3D, drawn by floor3d.js from the scene at the foot of the page. The message covers the stage until the room is drawn; when it cannot be, the plan below takes its place and the 3D button says why. {% endcomment %}
Loading the room…
{% else %}

No racks are placed on this floor yet.

{% if perms.netbox_spatial_lens.change_rackplacement %} Place racks {% endif %}
{% endif %}
{% if rack_rows %} {% comment %} The racks as a table: every figure the plan carries, one row each, sorted by clicking a heading. The rows carry the same band and name as the racks on the plan, so the legend and the find box narrow the table and the plan together. {% endcomment %}

Racks {{ rack_rows|length }}

{% for filter in field_filters %} {% endfor %} {% for row in rack_rows %} {% if row.space_percent is not None %} {% else %} {% endif %} {% if row.power_percent is not None %} {% else %} {% endif %} {% for cell in row.placed.field_cells %} {% endfor %} {% endfor %}
Tags
{{ row.rack.name }} {{ row.rack.role|placeholder }} {{ row.rack.location|placeholder }} {{ row.rack.u_height }}U {{ row.placed.device_count }} {{ row.space_percent|floatformat:0 }}% · {{ row.free_units|floatformat }}U free {{ ''|placeholder }} {{ row.power_percent|floatformat:0 }}% of {{ row.power_capacity_kw|floatformat }} kW {{ ''|placeholder }} {% if row.rack.cooling_capability %} {{ row.rack.get_cooling_capability_display }}{% if row.rack.cooling_capacity %}, {{ row.rack.cooling_capacity|floatformat }} kW{% endif %} {% else %} {{ ''|placeholder }} {% endif %} {{ row.rack.asset_tag|placeholder }} {% for tag in row.rack.tags.all %}{% tag tag %} {% empty %}{{ ''|placeholder }}{% endfor %} {% for value in cell.values %}{{ value.label }} {% empty %}{{ ''|placeholder }}{% endfor %}
{% endif %}
{% if overlay %}

{{ overlay.label }}

{% comment %} The counts are in the legend rather than in a sentence below it, so the number sits beside the colour it belongs to. A whole floor of grey must read as "nobody has recorded this", never as a clean bill of health. {% endcomment %} {% include 'netbox_spatial_lens/inc/legend.html' with legend=legend filter='racks' %}
{% endif %} {% comment %} The cabling has colours of its own, and until this card existed nothing on the page said what they meant: a red stub and a blue line were two colours the reader had to guess at. {% endcomment %} {% if show_runs %}

Cabling {{ runs|length }} route{{ runs|pluralize }}

{% include 'netbox_spatial_lens/inc/legend.html' with legend=cabling_legend %} {% comment %} The same rule as the overlays: nothing drawn must never be mistaken for nothing to draw. A floor whose racks are cabled only internally shows no lines, and without these sentences the toggle looks broken rather than answered. {% endcomment %} {% if not runs %}

No cable joins two racks on this floor.

{% endif %} {% if not exits %}

Nothing on this floor is cabled off it.

{% endif %}
{% endif %}

Floor

{% comment %} `effective_site` rather than `site`: a floor bound to a location has no site of its own, and the room is not in less of a site for having been bound the other way. {% endcomment %}
Site{{ object.effective_site|linkify|placeholder }}
Location{{ object.location|linkify|placeholder }}
Size{{ object.width }} × {{ object.depth }} {{ object.get_unit_display|lower }}
Racks placed{{ placed_racks|length }}
Not yet placed {% if unplaced_racks %} {{ unplaced_racks|length }} {% else %} 0 {% endif %}
{% if placed_racks %} {{ floor3d_config|json_script:"lens-floor3d-config" }} {% endif %} {% endblock %}