{# SPDX-License-Identifier: Apache-2.0 #} {# Copyright (C) 2025 Marcin Zieba #} {% extends 'generic/_base.html' %} {% block title %}Apply Rule — Preview{% endblock %} {% block content %}
Back to rule list
{# ── Rule summary ─────────────────────────────────────────────────────────────── #}
Rule
Module Type
{% if rule.module_type_is_regex %} {{ rule.module_type_pattern }} regex {% elif rule.module_type %} {{ rule.module_type.model }} {% else %} {% endif %}
Parent Module Type
{% if rule.parent_module_type %} {{ rule.parent_module_type.model }} {% else %} Any {% endif %}
Device Type
{% if rule.device_type %} {{ rule.device_type.model }} {% else %} Any {% endif %}
Platform
{% if rule.platform %} {{ rule.platform.name }} {% else %} Any {% endif %}
Name Template
{{ rule.name_template }}
{% if rule.channel_count %}
Channels
{{ rule.channel_count }} starting at {{ rule.channel_start }}
Breakout Mode
{{ rule.get_breakout_mode_display }}
{% endif %} {% if rule.parent_name_template %}
Parent Name Template
{{ rule.parent_name_template }}
{% endif %}
{# ── Preview table ────────────────────────────────────────────────────────────── #}
{% csrf_token %}
Preview
{% if has_more %} Showing {{ preview|length }} of {{ total_checked }}+ {{ checked_unit }} examined that would change (batch limit: {{ batch_limit }}) {% else %} {{ preview|length }} would change ({{ total_checked }} {{ checked_unit }} examined) {% endif %}
{% if preview %}
{% for entry in preview %} {% endfor %}
Device Module Type Current Name New Name(s)
{% if entry.module.device %} {{ entry.module.device }} {% else %}{% endif %} {% if entry.module.module_type %} {{ entry.module.module_type.model }} {% else %} {% endif %} {{ entry.current_name }} {% for detail in entry.name_details %} {{ detail.name }} {% if detail.channel_id %} ch {{ detail.channel_id }} {% endif %} {% if not forloop.last %}
{% endif %} {% endfor %}
{% else %}
No installed interfaces would be affected by this rule.
{% endif %}
{# ── Apply controls ───────────────────────────────────────────────────────────── #} {% if preview %}
Apply
{% if has_more %}
At least {{ batch_limit }} {{ checked_unit }} would be affected. Synchronous apply is limited to {{ batch_limit }} {{ checked_unit }} per run. Use Run as Background Job to process all of them.
{% endif %} {% if can_apply %} {% else %}

You do not have permission to apply interface changes. (requires dcim.change_interface)

{% endif %}
{% endif %}
{# ── Flat → channelized conversion ────────────────────────────────────────────── #} {% if conversions %}
{% csrf_token %}
Convert flat families
{% if conversions_have_more %} Showing {{ conversions|length }} of {{ conversions|length }}+ flat family(ies) found (batch limit: {{ batch_limit }}) {% else %} {{ conversions|length }} flat family(ies) found {% endif %}
These modules carry a flat breakout family an earlier apply installed. Converting one rewrites existing rows: the ch-0 interface keeps its ID, its cable and its type and becomes the channelized parent, while a new channel 1 interface takes over its name and its configuration. Applying a rule never does this — confirm it here, per family.
{% if conversions_have_more %}
More families are waiting. Each one is checked by performing the conversion and rolling it back, so this page checks and converts at most {{ batch_limit }} per run. Use Convert as Background Job to convert all of them.
{% endif %}
{% for verdict in conversions %} {% endfor %}
Device Current Family New Family Status
{% if verdict.convertible %} {% endif %} {% if verdict.module.device %} {{ verdict.module.device }} {% else %}{% endif %} {% for name in verdict.current_names %}
{{ name }}
{% endfor %}
{% for detail in verdict.name_details %}
{{ detail.name }} {% if detail.channel_id %} ch {{ detail.channel_id }} {% else %} parent {% endif %}
{% endfor %}
{% if verdict.convertible %} Convertible {% else %} Blocked {% endif %}
{% if verdict.convertible %} {{ verdict.metadata_note }} {% else %} {{ verdict.reason }} {% endif %}
{% if can_apply %} {% else %} {% endif %}
{% endif %} {% endblock %}