{# HTMX template for device validation details modal #} {# Redesigned to match the sync page's clean table layout #}
| Status | {% if libre_device.status == 1 or libre_device.status == "1" %} Up {% elif libre_device.status == 0 or libre_device.status == "0" %} Down {% else %} Unknown {% endif %} |
|---|---|
| Hostname | {{ libre_device.hostname }} |
| ID | {{ libre_device.device_id }} |
| IP | {{ libre_device.ip|default:"—" }} |
| Location | {{ libre_device.location|default:"—" }} |
| Field | NetBox Value | LibreNMS Value |
|---|---|---|
| Name | {% if validation.existing_device %} {{ validation.existing_device.name }} {% if validation.name_sync_available %} {% endif %} {% else %} New device {% endif %} | {{ validation.resolved_name|default:libre_device.sysName|default:libre_device.hostname }} |
| Site | {% if validation.existing_device and validation.existing_device.site %} {{ validation.existing_device.site }} {% if validation.site.site and validation.existing_device.site.pk == validation.site.site.pk %} {% endif %} {% elif validation.site.site %} {{ validation.site.site.name }} {% else %} No matching site {% endif %} | {{ libre_device.location|default:"—" }} |
| Device Type |
{% if validation.device_type_mismatch %}
{{ validation.existing_device.device_type }}
{% if libre_device.hardware and libre_device.hardware != "-" %}
{% include "netbox_librenms_plugin/htmx/_dt_mapping_form.html" with preselect_device_type=validation.existing_device.device_type submit_label="Map LibreNMS hardware to current type" %}
{% endif %}
{% elif validation.existing_device and validation.existing_device.device_type %}
{{ validation.existing_device.device_type }}
{% if sync_info and not sync_info.device_type_synced and sync_info.librenms_device_type %}
{% elif sync_info and not sync_info.device_type_synced and not sync_info.librenms_device_type and libre_device.hardware and libre_device.hardware != "-" %}
{# LibreNMS hardware has no NetBox mapping yet -- let the user create one, pre-selected to the existing device type so the common case is one click. #}
No mapping for LibreNMS hardware
{% include "netbox_librenms_plugin/htmx/_dt_mapping_form.html" with preselect_device_type=validation.existing_device.device_type submit_label="Map LibreNMS hardware to current type" %}
{% elif validation.device_type.device_type %}
{% endif %}
{% elif validation.device_type.device_type %}
{{ validation.device_type.device_type }}
{% else %}
{% if libre_device.hardware and libre_device.hardware != "-" %}
No matching type
{% include "netbox_librenms_plugin/htmx/_dt_mapping_form.html" %}
{% else %}
No matching type
{% endif %}
{% endif %}
|
{{ libre_device.hardware|default:"—" }} |
| Serial | {% if validation.existing_device %} {% if validation.existing_device.serial %} {{ validation.existing_device.serial }} {% else %} Not set {% endif %} {% if sync_info and not sync_info.serial_synced %} {% if validation.serial_action == 'conflict' %} {% else %} {% endif %} {% elif sync_info and sync_info.serial_synced and sync_info.librenms_serial != '-' %} {% endif %} {% else %} — {% endif %} | {{ libre_device.serial|default:"—" }} {% if validation.serial_duplicate %} Conflict {% endif %} |
| {% if validation.import_as_vm %}Role{% else %}Device Role{% endif %} | {% if validation.existing_device and validation.existing_device.role %} {{ validation.existing_device.role }} {% elif validation.device_role.role %} {{ validation.device_role.role.name }} {% else %} No role assigned {% endif %} | — |
| Platform | {% if validation.existing_device and validation.existing_device.platform %} {{ validation.existing_device.platform }} {% if sync_info and not sync_info.platform_synced %} {% if sync_info.platform_info.platform_exists %} {% else %} {% endif %} {% elif sync_info and sync_info.platform_synced %} {% endif %} {% include "netbox_librenms_plugin/htmx/_platform_manage_icon.html" %} {% elif validation.existing_device %} {# Existing device with no platform assigned #} Not set {% if validation.platform.platform or sync_info and sync_info.platform_info.platform_exists %} {% endif %} {% include "netbox_librenms_plugin/htmx/_platform_manage_icon.html" %} {% elif validation.platform.platform %} {# New import — platform will be assigned on import #} {{ validation.platform.platform.name }} {% include "netbox_librenms_plugin/htmx/_platform_manage_icon.html" %} {% else %} {% if not libre_device.os or libre_device.os == "-" %} Optional {% endif %} {% include "netbox_librenms_plugin/htmx/_platform_manage_icon.html" %} {% endif %} | {{ libre_device.os|default:"—" }} |
| Cluster | {% if validation.cluster.cluster %} {{ validation.cluster.cluster.name }} {% else %} No cluster assigned {% endif %} | — |
| Rack | {% if validation.rack.rack %} {% if validation.rack.rack.location %} {{ validation.rack.rack.location.name }} — {{ validation.rack.rack.name }} {% else %} {{ validation.rack.rack.name }} {% endif %} {% else %} Optional {% endif %} | — |
| Primary IP | {% if validation.existing_device and validation.existing_device.primary_ip %} {{ validation.existing_device.primary_ip }} {% elif libre_device.ip %} {{ libre_device.ip }} {% else %} No primary IP {% endif %} | {{ libre_device.ip|default:"—" }} |