{% extends 'common/base.html' %} {% load permissions %} {% block title %}::{{ object.label }}{% endblock %} {% block content %}

{{ object.label }}

{% if object.locations|length == 1 %} {{ object.locations.0 }} {% elif object.locations|length > 1 %} {% for location in object.locations %} {{ location }} {% endfor %} {% endif %}

{% if object.ssh_link %} {% endif %}
{% for port in sorted_ports %} {% endfor %}
Port # Label Name DCIM Connection Racks Connections
{{ port.number }} {{ port.label }} {{ port.switch_port_name }} {% if port.dcim_device_type == DCIM_SERVER %} Server ID {{ port.dcim_server_id }} {% elif port.dcim_device_type == DCIM_SWITCH %} Switch ID {{ port.dcim_server_id }} {% elif port.dcim_device_type %} unknown device ID {{ port.dcim_server_id }} {% else %} available {% endif %} {% if port.l2addresses.all %}
    {% if port.dcim_device_type == DCIM_SWITCH %}
  • {{ port.l2addresses.count }} connected MAC address(es)
  • {{ port.l2addresses_with_objects|length }} connected inventory object(s)
  • {% else %} {% for address in port.l2addresses_with_objects %}
  • {{ address }} {{ address.inventory_object }} {% if address.inventory_object.orphan_dcim_id and not address.inventory_object.dcim_id %} orphan {% endif %} {% if address.inventory_object.location_name %} {{ address.inventory_object.location_name }} {% endif %}
  • {% endfor %} {% if port.l2addresses_without_objects|length %}
  • {{ port.l2addresses_without_objects|length }} MAC address(es) without inventory objects
  • {% endif %} {% endif %}
{% else %} None {% endif %}
{% endblock content %}