{% load helpers %} {% include 'inc/messages.html' %} {% if request.htmx %} {% include "netbox_librenms_plugin/inc/_sync_cache_countdown.html" with cache_expiry=vlan_sync.cache_expiry cache_container_id="vlan-cache-countdown" cache_countdown_id="vlan-countdown-timer" cache_oob=True %} {% endif %} {% if vlan_sync.error_message %}
{{ vlan_sync.error_message }}
{% elif not vlan_sync.vlan_table or not vlan_sync.vlan_table.rows %}

No VLAN data loaded. Click Refresh VLANs to fetch data from LibreNMS.

{% else %} {# Migrated donors must not sync: hiding only the button leaves the POST form live (Enter in a filter still submits), so drop the form in migrated mode. #} {% if migrated_to_marker %}
{% else %} {% with model_name=vlan_sync.object|meta:"model_name" %}
{% endwith %} {% endif %} {% comment %} CSRF + server_key must render in BOTH modes: the VLAN verify JS (librenms_sync.js verify-vlan-group / verify-vlan-sync-group) reads document.querySelector('[name=csrfmiddlewaretoken]') and posts server_key, and the VLAN table is interactive in migrated mode too. Only the form-submit action input is form-only, so it stays gated. {% endcomment %} {% csrf_token %} {% include "netbox_librenms_plugin/inc/_hidden_server_key.html" with server_key=vlan_sync.server_key %} {% if not migrated_to_marker %} {% endif %} {% if not migrated_to_marker %}
{% endif %}
Select a VLAN Group for each row, or leave empty for global VLANs
Matching values Mismatched values Not present in NetBox
Filters apply to currently displayed VLANs.
{% include 'netbox_librenms_plugin/inc/paginator.html' with table=vlan_sync.vlan_table %} {% include 'inc/table.html' with table=vlan_sync.vlan_table %} {% include 'netbox_librenms_plugin/inc/paginator.html' with table=vlan_sync.vlan_table %}
{% if migrated_to_marker %}
{% else %} {% endif %} {% endif %}