{% load i18n %} {% comment %} Renders one node of the address tree. node = { name, url, kind: 'group'|'category'|'leaf', ip_ref: {str,url}|None, children: [...] } depth = current nesting depth (0 = top-level) prefix = 'src' or 'dst' (for unique HTML IDs) forloop_counter = parent forloop.counter (for unique IDs) {% endcomment %} {% if node.kind == "category" %} {% if node.count == 0 and not node.children %}
{{ node.name }} 0
{% else %}
{{ node.name }} {{ node.count }}
{% for child in node.children %} {% include "netbox_nsm/inc/addr_tree_node.html" with node=child depth=depth|add:1 prefix=prefix forloop_counter=forloop.counter %} {% endfor %} {% if node.lazy_load %} {% endif %}
{% endif %} {% elif node.kind == "group" %} {% if node.children or node.ipam_stats or node.addr_drilldown_lazy %}
{% if node.diff_group %} {% if prefix == "ipa" and node.is_cell_direct %} {{ node.name }} {% else %} {{ node.name }} {% endif %} {% else %} {% if prefix == "ipa" and node.is_cell_direct %} {{ node.name }} {% else %} {{ node.name }} {% endif %} {% endif %} {% if node.leaf_count and not node.ipam_stats %}{{ node.leaf_count }}{% endif %} {% if node.ip_ref %} {% if node.prefix_display_cidr %}{{ node.prefix_display_cidr }}{% else %}{{ node.ip_ref.str }}{% endif %}{% if node.ip_ref.ct and node.ip_ref.pk %}{% endif %} {% endif %} {% include "netbox_nsm/inc/ipa_object_tree_subnet_warning.html" %} {% include "netbox_nsm/inc/addr_ipam_stats.html" %} {% if node.count_duplicate %} {% trans "duplicate" %}{% if node.count_duplicate_of %} {% trans "in" %} {% if node.count_duplicate_of_url %}{{ node.count_duplicate_of }}{% else %}{{ node.count_duplicate_of }}{% endif %} {% endif %} {% endif %} {% if node.object_duplicate %} {% trans "duplicate" %}{% if node.object_duplicate_of %} {% trans "in" %} {% if node.object_duplicate_of_url %}{{ node.object_duplicate_of }}{% else %}{{ node.object_duplicate_of }}{% endif %} {% endif %} {% endif %} {% if node.is_doppelt %} {% endif %} {% if show_copy and node.copy_lines %} {% endif %}
{% if prefix == "ipa" %} {% include "netbox_nsm/inc/ipa_object_tree_expanded_warnings.html" %} {% if node.children %}
{% for child in node.children %} {% include "netbox_nsm/inc/addr_tree_node.html" with node=child depth=depth|add:1 prefix=prefix forloop_counter=forloop.counter %} {% endfor %}
{% endif %} {% if node.addr_drilldown_lazy %} {% include "netbox_nsm/inc/ipa_object_addr_drilldown.html" %} {% endif %} {% else %} {% for child in node.children %} {% include "netbox_nsm/inc/addr_tree_node.html" with node=child depth=depth|add:1 prefix=prefix forloop_counter=forloop.counter %} {% endfor %} {% endif %}
{% else %}
{{ node.name }} (leer)
{% endif %} {% else %} {# Leaf node #} {% if prefix == "ipa" and node.ct and node.addr_drilldown_lazy %}
{% else %}
{% endif %} {% if node.diff_fund %} {% trans "Fund" %} {% endif %} {% if node.prefix_display_cidr and not node.ip_ref %} {{ node.prefix_display_cidr }} {% elif node.diff_status %} {% include "netbox_nsm/inc/addr_diff_name_pill.html" %} {% elif prefix == "ipa" and node.is_cell_direct %} {{ node.name }} {% else %} {{ node.name }} {% endif %} {% if node.ip_ref %} {% if node.prefix_display_cidr %}{{ node.prefix_display_cidr }}{% else %}{{ node.ip_ref.str }}{% endif %}{% if node.ip_ref.ct and node.ip_ref.pk %}{% endif %} {% endif %} {% include "netbox_nsm/inc/ipa_object_tree_subnet_warning.html" %} {% for ref in node.related_refs %} {{ ref.label }}: {{ ref.name }} {% endfor %} {% if node.object_duplicate %} {% trans "duplicate" %}{% if node.object_duplicate_of %} {% trans "in" %} {% if node.object_duplicate_of_url %}{{ node.object_duplicate_of }}{% else %}{{ node.object_duplicate_of }}{% endif %} {% endif %} {% endif %} {% if node.is_doppelt %} {% endif %} {% if show_copy and node.copy_lines %} {% endif %} {% if prefix == "ipa" and node.ct and node.addr_drilldown_lazy %}
{% include "netbox_nsm/inc/ipa_object_tree_expanded_warnings.html" %} {% include "netbox_nsm/inc/ipa_object_addr_drilldown.html" %}
{% else %} {% endif %} {% endif %}