{% load helpers %} {% load static %}
{% 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" %}
{% csrf_token %} {% comment %} htmx includes the enclosing form's values on non-GET requests, so the refresh POST carries the tab's server_key and the view rebinds to it — otherwise the refresh fetches and caches under the GLOBAL selected server (mirrors _module_sync.html). {% endcomment %} {% include "netbox_librenms_plugin/inc/_hidden_server_key.html" %} {% if has_librenms_id %} {% with model_name=object|meta:"model_name" %} {% comment %} Resolve the refresh URL per object type, then render ONE button so the shared hx-vals (pagination + server_key forwarding) lives in a single place. {% endcomment %} {% if model_name == "device" %} {% url 'plugins:netbox_librenms_plugin:device_interface_sync' pk=object.pk as interface_sync_url %} {% elif model_name == "virtualmachine" %} {% url 'plugins:netbox_librenms_plugin:vm_interface_sync' pk=object.pk as interface_sync_url %} {% endif %} {% if interface_sync_url %} {% endif %} {% endwith %} {% endif %}
{% include 'netbox_librenms_plugin/_interface_sync_content.html' %}