{% load i18n helpers %} {# The machine drawing: filter form, drawing and tables. Everything is a GET parameter, so a drawing is a link. #}
{% if form.site_id %}
{{ form.site_id }}
{{ form.location_id }}
{% endif %}
{{ form.tag }}
{{ form.version }}
{% trans "Reset" %} {% trans "All filters apply together. A tag scope is the usual way to draw one machine of a line." %}
{% if not machine %}
{% trans "Choose a site, a location or one or more tags: the devices there, the zones they are in, their cables and every flow that leaves or enters them make one drawing for the technical file." %}
{% else %}
{% trans "Drawing (SVG)" %} {% trans "Devices (CSV)" %} {% trans "Cables (CSV)" %} {% trans "Connections (CSV)" %} {% if machine.access_paths is not None %} {% trans "Access paths (CSV)" %}{% endif %} JSON

{% trans "Machine drawing" %}

{{ scope.label }}{% if scope.version %} ยท {% trans "version" %} {{ scope.version }}{% endif %}
{% blocktrans with generated=machine.generated|date:"Y-m-d H:i" version=machine.version devices=diagram.devices cables=machine.cables|length flows=machine.flows|length %}Generated {{ generated }} from NetBox by netbox-ot {{ version }}: {{ devices }} devices, {{ cables }} cables, {{ flows }} flows to or from the outside.{% endblocktrans %}
{% if not machine.devices %}
{% trans "No devices you can view in this scope." %}
{% else %}

{% trans "Drawing" %}

{{ diagram.svg }}

{% trans "Devices" %} {{ machine.devices|length }}

{% for d in machine.devices %} {% endfor %}
{% trans "Device" %}{% trans "Role" %}{% trans "Manufacturer" %}{% trans "Model" %} {% trans "Serial" %}{% trans "Zone" %}{% trans "Firmware" %} {% trans "Addresses (NAT)" %}{% trans "Modules" %}
{{ d.name }} {{ d.role|placeholder }}{{ d.manufacturer }}{{ d.model }} {{ d.serial|placeholder }} {% if d.zone %}{{ d.zone }}{% for z in d.other_zones %}
{% trans "also" %} {{ z }}{% endfor %}{% else %}{{ ''|placeholder }}{% endif %}
{{ d.firmware|placeholder }} {% for a in d.addresses %}{{ a.interface }} {{ a.address }}{% if a.nat %} ⇄ {{ a.nat|join:", " }}{% endif %}{% if not forloop.last %}
{% endif %}{% empty %}{{ ''|placeholder }}{% endfor %}
{% for m in d.modules %}{% if m.bay %}{{ m.bay }}: {% endif %}{{ m.model }}{% if m.serial %}, S/N {{ m.serial }}{% endif %}{% if m.firmware %}, FW {{ m.firmware }}{% endif %}{% if not forloop.last %}
{% endif %}{% empty %}{{ ''|placeholder }}{% endfor %}

{% trans "Cables" %} {{ machine.cables|length }}

{% if machine.cables %}
{% for c in machine.cables %} {% endfor %}
{% trans "Cable" %}{% trans "Device" %}{% trans "Port" %}{% trans "Other end" %}{% trans "Port" %} {% trans "Type" %}{% trans "Status" %}{% trans "Leaves the machine" %}
{% if c.color %}{% endif %}{{ c.label }} {{ c.a.name }}{{ c.a.ports|placeholder }} {% if c.b.url %}{{ c.b.name }}{% else %}{{ c.b.name }}{% endif %}{{ c.b.ports|placeholder }} {{ c.type|placeholder }}{{ c.status }} {% if c.leaves %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}
{% else %}
{% trans "No cables on the devices in scope." %}
{% endif %}

{% trans "Connections to and from the outside" %} {{ machine.rules|length }}

{% if machine.rules %}
{% for label in rule_labels %}{% endfor %} {% for rule in machine.rules %} {% for value in rule.values %}{% endfor %} {% endfor %}
{{ label }}
{{ value|placeholder }}
{% else %}
{% trans "No flow with a verdict leaves or enters the zones of these devices." %}
{% endif %} {% if machine.not_exported %} {% endif %}
{% if machine.access_paths is not None %}

{% trans "Access paths into the machine" %} {{ machine.access_paths|length }}

{% if machine.access_paths %}
{% for p in machine.access_paths %} {% endfor %}
{% trans "Access path" %}{% trans "Route" %}{% trans "Origin" %}{% trans "Method" %} {% trans "Target" %}{% trans "Authentication" %}{% trans "Status" %} {% trans "Approved by" %}{% trans "Expires" %}
{{ p.path }}{{ p.route }}{{ p.origin }}{{ p.method }} {{ p.target|placeholder }}{{ p.authentication }}{{ p.status }} {{ p.approved_by|placeholder }}{{ p.expires|placeholder }}
{% else %}
{% trans "No access path targets or runs through a device in scope." %}
{% endif %}
{% endif %} {% endif %} {% endif %}