{% extends 'generic/object.html' %} {% block content %}
{# ================= LEFT COLUMN ================= #}
{# --- Network panel --- #}
Network
Name
{{ object.name }}
User
{% if object.user %}{{ object.user }}{% else %}{% endif %}
Driver
{% if object.driver %}{{ object.driver }}{% else %}{% endif %}
{# Subnets: linked Prefixes + free-text CIDRs #}
Subnets
{% if object.prefixes.exists %} {% for p in object.prefixes.all %} {{ p.prefix }}{% if not forloop.last or object.subnets_text %}, {% endif %} {% endfor %} {% endif %} {% if object.subnets_text %} {% for s in object.subnets_text %} {{ s }}{% if not forloop.last %}, {% endif %} {% endfor %} {% endif %} {% if not object.prefixes.exists and not object.subnets_text %} {% endif %}
Gateway
{% if object.gateway %}{{ object.gateway }}{% else %}{% endif %}
Label
{% if object.label %}{{ object.label }}{% else %}{% endif %}
{# --- Tags panel --- #}
Tags
{% if object.tags.count %}
{% for tag in object.tags.all %} {{ tag.name }} {% endfor %}
{% else %} No tags {% endif %}
{# --- Comments panel --- #}
Comments
{% if object.comments %}
{{ object.comments }}
{% else %} No comments {% endif %}
{# ================= RIGHT COLUMN ================= #}
{# --- Pods panel --- #}
Pods
{% if pod_attachments %}
{% for att in pod_attachments %} {% with pod=att.pod %} {% endwith %} {% endfor %}
Name User Status
{{ pod }} {{ pod.user|default:"—" }} {{ pod.get_status_display|default:"—" }}
{% else %} No pods associated. {% endif %}
{# --- Containers panel --- #}
Containers
{% if container_attachments %}
{% for att in container_attachments %} {% with c=att.container %} {% endwith %} {% endfor %}
Name Status Pod
{{ c }} {{ c.get_status_display|default:"—" }} {% if c.pod %} {{ c.pod }} {% else %} {% endif %}
{% else %} No containers associated. {% endif %}
{# --- Devices panel --- #}
Devices
{% if object.devices.exists %}
{% for d in object.devices.all|dictsort:"name" %} {% endfor %}
Name Status Primary IPv4 Primary IPv6
{{ d }} {% with s=d.status %} {% if s == "active" %} {{ d.get_status_display }} {% elif s == "offline" %} {{ d.get_status_display }} {% elif s == "planned" or s == "staged" %} {{ d.get_status_display }} {% elif s == "failed" %} {{ d.get_status_display }} {% else %} {{ d.get_status_display }} {% endif %} {% endwith %} {% if d.primary_ip4 %} {{ d.primary_ip4 }} {% else %}{% endif %} {% if d.primary_ip6 %} {{ d.primary_ip6 }} {% else %}{% endif %}
{% else %} No devices associated. {% endif %}
{# --- Virtual Machines panel --- #}
Virtual Machines
{% if object.virtual_machines.exists %}
{% for vm in object.virtual_machines.all|dictsort:"name" %} {% endfor %}
Name Status Primary IPv4 Primary IPv6
{{ vm }} {% with s=vm.status %} {% if s == "active" %} {{ vm.get_status_display }} {% elif s == "offline" %} {{ vm.get_status_display }} {% elif s == "planned" or s == "staged" %} {{ vm.get_status_display }} {% else %} {{ vm.get_status_display }} {% endif %} {% endwith %} {% if vm.primary_ip4 %} {{ vm.primary_ip4 }} {% else %}{% endif %} {% if vm.primary_ip6 %} {{ vm.primary_ip6 }} {% else %}{% endif %}
{% else %} No virtual machines associated. {% endif %}
{% endblock %}