{% load helpers %} {# Modal body fragment for the module replace / move dialog. #} {# Rendered server-side by ModuleMismatchPreviewView and injected into #htmx-modal-body via JS. #}

Comparing the module currently in NetBox with the LibreNMS inventory data.

{% if installed_module %} {{ installed_module.module_type.model }} {% else %}-{% endif %} {{ librenms_model }} {{ installed_serial|default:"-" }} {{ librenms_serial|default:"-" }}
Currently in NetBox From LibreNMS
Bay {{ bay_name }}
Module Type
Serial
{% if type_mismatch %}
Different module type — the installed module type does not match LibreNMS. Replacing will delete the current module and install {{ librenms_model }}.
{% elif serial_mismatch %}
Same module type, different serial — the module may have been physically replaced.
{% endif %} {% if serial_conflict %}
Serial conflict: {{ librenms_serial }} is currently installed at {{ serial_conflict.device.name }} / Bay: {{ serial_conflict.module_bay.name }}.
Replace will also remove it from that location. Move will update its location to this bay instead of creating a new entry.
{% elif serial_conflict_ambiguous %}
Ambiguous serial conflict: Serial {{ librenms_serial }} is assigned to multiple modules. Please resolve the conflict manually before proceeding.
{% endif %}
{% if serial_mismatch and not type_mismatch and not serial_conflict and not serial_conflict_ambiguous and installed_module %} {# Quick serial-only update — no delete/recreate needed #}
{% csrf_token %}
{% endif %} {% if serial_conflict %} {# Move the existing module here rather than creating a new entry #}
{% csrf_token %}
{% endif %} {# Replace: delete current + install fresh from LibreNMS data #} {% if installed_module and not serial_conflict_ambiguous %}
{% csrf_token %} {% if serial_conflict %} {% endif %}
{% endif %}