{% extends 'generic/object.html' %} {% load helpers %} {% load netbox_containers_helpers %} {% block extra_controls %} {{ block.super }} {% if perms.netbox_containers.add_networkattachment %}
{% endif %} {% endblock %} {% block content %}
{# ================= LEFT COLUMN ================= #}
{# --- Pod panel --- #}
Pod
Name
{{ object.name }}
User
{% if object.user %}{{ object.user }}{% else %}{% endif %}
Status
{% if object.status %}{{ object.status }}{% else %}{% endif %}
Published Ports
{% if object.published_ports %}
{{ object.published_ports }}
{% else %} {% endif %}
Add Host
{% if object.add_host %}
{% for item in object.add_host %}{{ item }}{% if not forloop.last %}
{% endif %}{% endfor %}
{% else %} {% endif %}
Infra Container
{% if object.infra_container %} {{ object.infra_container }} {% 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 ================= #}
{# --- Networks panel --- #}
Networks
{% if object.network_attachments.exists %}
{% for att in object.network_attachments.all %} {% endfor %}
Type Network / Options
{{ att.get_mode_display }} {% if att.network %} {{ att.network }} {% else %} {{ att.options|default:"—" }} {% endif %}
{% else %} No networks associated. {% endif %}
{# --- Containers panel --- #}
Containers
{% if object.containers.exists %}
{% for c in object.containers.all|dictsort:"name" %} {% endfor %}
Name Status Image Infra
{{ c }} {{ c.get_status_display|default:"—" }} {% if c.image_tag %} {{ c.image_tag }} {% else %} {% endif %} {{ c.is_infra|render_boolean }}
{% 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 %}