{% load helpers %} {% include 'inc/messages.html' %} {% if request.htmx %} {% include "netbox_librenms_plugin/inc/_sync_cache_countdown.html" with cache_expiry=cable_sync.cache_expiry cache_container_id="cable-cache-countdown" cache_countdown_id="cable-countdown-timer" cache_oob=True %} {% endif %} {% if cable_sync.table %} {# 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 %}
{% comment %} No POST form in migrated mode, but the cable table still renders interactive controls whose verify-cable fetch (handleCableChange) reads document.querySelector('[name=csrfmiddlewaretoken]').value and input[name="server_key"]. Emit standalone hidden inputs so those JS-driven requests don't hit a null CSRF token (TypeError/403) or fall back to the default server on a non-default deployment. A bare hidden input never auto-submits, so it doesn't reintroduce the live-form problem migrated mode avoids. Mirrors _interface_sync_content.html. {% endcomment %} {% if cable_sync.server_key %}{% endif %} {% else %}
{# The sync POST's own inputs (token + selected_port) live inside the branch only. #} {% csrf_token %} {% if cable_sync.server_key %}{% endif %} {% endif %}
{% if not migrated_to_marker %} {% endif %} info
Filters apply to currently displayed cables.
{% if cable_sync.table.attrs.id == "librenms-cable-table-vc" %} {% endif %}
{% include 'netbox_librenms_plugin/inc/paginator.html' with table=cable_sync.table %} {% include 'inc/table.html' with table=cable_sync.table %} {% include 'netbox_librenms_plugin/inc/paginator.html' with table=cable_sync.table %}
{% if migrated_to_marker %}
{% else %} {% endif %} {% else %}

No cable data loaded. Click Refresh Cables to fetch data from LibreNMS.

{% endif %}