{# Network map (Hani #1 2026-10-17): pictograms, health, collapse, link speed and hover details. #} {% macro icon(kind, x, y) -%} {%- endmacro %} {% macro map_svg(nm, asset_id, fit, base=none, editable=false) -%}{% set toggle_base = base if base else '/inventory/assets/' ~ asset_id ~ '?tab=relationships' %} {% if editable %}{# R12.8 (Hani #1 2026-10-27/28): the map toolbar - add a network cloud; containers #}
{{ fresh_tag("map:toolbar") }} {% if nm.lines|selectattr('link_ref')|list %}{% endif %}

Add a network cloud

Choose the link, then its networks - connected (the network on the link) or routed (reached through it). They are allocated in IP addresses and show as a cloud on the link.

Containers

A container is a coloured frame around devices that work together, like a Proxmox tag - for example NEXXVU.COM, NEXXVU-BACKEND, NEXXVU-CX-PORTAL. A device can be in several.

{% if nm.containers %}{% endif %}

New container

Colour
{% for color in ['#2563eb', '#16a34a', '#d97706', '#dc2626', '#7c3aed', '#0891b2', '#db2777', '#4b5563'] %}{% endfor %}
Devices
{% for d in nm.devices or [] %}{% endfor %}
{% endif %} {% if nm.waiting and fit %}
{% endif %} {# R12.8: containers behind everything - a soft frame in the container's colour with its name #} {% for f in nm.frames or [] %}{{ f.name }} · {{ f.count }} device{{ '' if f.count == 1 else 's' }}{{ f.name }}{% endfor %} {% for l in nm.lines %}{{ l.hover }}{% if l.flow %}{% for off in l.flow.offsets %}{% endfor %}{% endif %}{% endfor %} {# R12.6 (Hani #1 brief): a small glassy cloud on each link that carries an IP network; several networks stack #} {% for l in nm.lines if l.clouds %}{% for c in l.clouds|reverse %}{% set i = l.clouds|length - loop.index %}{{ c.cidr }} · IPv{{ c.family }} · /{{ c.cidr.split('/')[1] }}{% if c.role == 'routed' %} · routed over this link{% endif %}{% if c.description %} {{ c.description }}{% endif %}{% if c.kind == 'public' %} Public network{% endif %} {{ l.link_name }} · click for the link's networks{% endfor %}{% if l.clouds|length > 1 %}{{ l.clouds|length }}{% endif %}{% endfor %} {# R12.5 (Hani #1 brief): no text on the links - the interface, speed and traffic are in the hover; moving dots show the traffic #} {% if editable %}{% for l in nm.lines if l.grip %}Drag onto another device to connect {{ l.link_name.split(' → ')[0] }} there instead{% endfor %}{% endif %} {% for n in nm.nodes %}{{ n.name }} · {{ n.role }} {{ n.health_reason }}{% if n.address %} Address: {{ n.address }}{% endif %}{% if n.rack %} Placement: {{ n.rack }}{% endif %}{% for c in n.stripes or [] %}{% endfor %} {% if n.picture %}{% else %}{{ icon(n.kind, n.x + 24, n.y + nm.box_h / 2) }}{% endif %} {{ n.name|truncate(17, True, '…', 0) }}{{ n.role|truncate(20, True, '…', 0) }} {% if n.children %}{{ ('Show the ' ~ n.hidden_below ~ ' device(s) below') if n.collapsed else 'Collapse the devices below' }}{{ '+' if n.collapsed else '−' }}{% if n.collapsed %}{{ n.hidden_below }} hidden{% endif %}{% endif %} {% endfor %} {% if nm.waiting %}{% endif %}{% if nm.waiting and fit %}
{% endif %} {% if fit and asset_id and nm.summary_enabled %}
{% endif %} {% if editable %}

Drag a device sideways to change its place among the devices under the same parent (map only){% if nm.waiting %}; drag a device from Not on the map yet onto a device to connect it{% endif %}.

Place the device

{% endif %} {%- endmacro %}