{% extends 'netbox_ip_history/base.html' %} {% load i18n %} {% block title %}{% if ip %}{{ ip }} | {% endif %}{% trans "IP History" %}{% endblock %} {% block page_title %}{% if ip %}{{ ip }}{% else %}{% trans "IP History" %}{% endif %}{% endblock %} {% block subtitle %} {% if ip %} {% trans "Timeline" %} {% endif %} {% endblock %} {% block ip_history_content %}
{# Object list tab #}
{# Quick Search & Controls Bar matching NetBox #}
{% if ip and events %} {# Metric Summary Cards matching netbox-ping #}
{% trans "Target IP Address" %}
{{ ip }}
{% if form.cleaned_data.vrf %}{% trans "VRF:" %} {{ form.cleaned_data.vrf }}{% else %}{% trans "Scope: Global / Any" %}{% endif %}
{% trans "Total Events" %}
{{ events|length }}
{% if stats.sources_count %}{{ stats.sources_count }} {% trans "Distinct Source(s)" %}{% else %}{{ events|length }} {% trans "Recorded Events" %}{% endif %}
{% trans "First Seen" %}
{% if stats.first_seen %}{{ stats.first_seen|date:"Y-m-d H:i" }}{% else %}—{% endif %}
{% trans "Earliest lifecycle activity" %}
{% trans "Last Seen" %}
{% if stats.last_seen %}{{ stats.last_seen|date:"Y-m-d H:i" }}{% else %}—{% endif %}
{% trans "Most recent activity" %}
{% endif %} {# Objects Table #}
{% for event in events %} {% empty %} {% endfor %}
{% trans "Timestamp" %} {% trans "IP Address" %} {% trans "VRF" %} {% trans "Event" %} {% trans "Source" %} {% trans "Host / Owner" %} {% trans "Host 2 / DNS" %} {% trans "Interface" %} {% trans "User" %}
{{ event.timestamp|date:"Y-m-d" }} {{ event.timestamp|date:"H:i:s T" }} {{ event.ip_address }}{% if event.prefix_length %}/{{ event.prefix_length }}{% endif %} {% if event.vrf and event.vrf != "Global" %} {{ event.vrf }} {% else %} {% trans "Global" %} {% endif %} {{ event.event_type_display|default:event.event_type }} {% if event.native %} NetBox {% else %} {{ event.source }} {% endif %}
{{ event.owner_name|default:event.hostname|default:"—" }}
{% if event.description %} {{ event.description }} {% endif %}
{% if event.owner_name and event.hostname and event.owner_name != event.hostname %} {{ event.hostname }} {% elif event.dns_name and event.dns_name != event.owner_name and event.dns_name != event.hostname %} {{ event.dns_name }} {% else %} — {% endif %} {% if event.interface_name %} {{ event.interface_name }} {% else %} — {% endif %} {% if event.username %} {{ event.username }} {% else %} — {% endif %} {% if event.pk %} {% endif %}
{% if ip %} {% trans "No historical events found matching query." %} {% else %} {% trans "No IP history queried yet. Use quick search above or filter tab." %} {% endif %}
{# Standard NetBox Pagination Footer #}
{% trans "Showing" %} {% if events %}1-{{ events|length }}{% else %}0{% endif %} {% trans "of" %} {{ events|length }} {% trans "events" %}
{# Filters Tab #}
{# Search Field Group #}
{{ form.ip }}
{# Attributes Field Group #}

{% trans "Attributes" %}

{{ form.vrf }}
{{ form.event_type }}
{{ form.source }}
{# Host & Scope Field Group #}

{% trans "Host & Scope" %}

{{ form.owner }}
{{ form.username }}
{# Timeframe Field Group #}

{% trans "Timeframe" %}

{{ form.date_from }}
{{ form.date_to }}
{{ form.oldest_first }}
{# Sticky Actions Footer matching NetBox Filter Views #}
{% endblock ip_history_content %}