{% load helpers %} {% include 'inc/messages.html' %} {% if request.htmx %} {% include "netbox_librenms_plugin/inc/_sync_cache_countdown.html" with cache_expiry=interface_sync.cache_expiry cache_container_id="cache-countdown" cache_countdown_id="countdown-timer" cache_oob=True %} {% endif %} {% if interface_sync.table %} {% if interface_sync.oob_incomplete %} {% endif %} {% if interface_sync.relationship_data_incomplete %} {% endif %} {# 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. #} {% with model_name=interface_sync.object|meta:"model_name" %} {% if migrated_to_marker %}
{% comment %} No POST form in migrated mode, but the interface table still renders interactive relationship/VC-member dropdowns whose verify-interface POST reads the token via document.querySelector('[name=csrfmiddlewaretoken]'). Emit a standalone token so those JS-driven requests don't hit a null token (TypeError/403). A bare hidden input never auto-submits, so it doesn't reintroduce the live-form problem flagged above. The same JS handlers read input[name="server_key"] to scope verify/sync POSTs to the right LibreNMS server; without it, migrated-mode requests on a non-default server fall back to null and hit the wrong server/cache. Emit it here too (still no auto-submit). {% endcomment %} {% comment %} Prefer the marker-scoped server_key (the server the donor was migrated under), falling back to the active interface_sync.server_key — the same precedence the migrated Move button uses, so JS handlers reading this input target the right LibreNMS server in either case. {% endcomment %} {% with effective_server_key=migrated_to_marker.server_key|default:interface_sync.server_key %} {% include "netbox_librenms_plugin/inc/_hidden_server_key.html" with server_key=effective_server_key %} {% endwith %} {% else %}
{# Form-only inputs live inside the form branch so migrated (donor) mode, which renders a plain
wrapper, never emits hidden fields outside any . #} {% csrf_token %} {% if interface_sync.server_key %}{% endif %} {% endif %} {% endwith %} {% block table_actions %}
{% if not migrated_to_marker %} {% endif %} info
{% endblock %}
{% if interface_sync.object.virtual_chassis %} {% endif %} {% if interface_sync.netbox_only_interfaces %} {{interface_sync.netbox_only_interfaces|length}} NetBox only interfaces {% endif %}
Matching values Mismatched values Not present in NetBox
Filters apply to currently displayed interfaces. Adjust the "per page" setting to apply the filters to more interfaces.
{% if interface_sync.table.attrs.id == 'librenms-interface-table' %} {% endif %}
{% include 'netbox_librenms_plugin/inc/paginator.html' with table=interface_sync.table %} {% include 'inc/table.html' with table=interface_sync.table %} {% include 'netbox_librenms_plugin/inc/paginator.html' with table=interface_sync.table %}
{% if migrated_to_marker %}
{% else %}
{% endif %} {% else %}

No interface data loaded. Click Refresh Interfaces to fetch data from LibreNMS.

{% endif %}