limits ip addresses on interface tables #14645

This commit is contained in:
Abhimanyu Saharan 2024-01-19 22:34:30 +05:30 committed by Jeremy Stretch
parent ebf6ce1b01
commit 749fc31bc4

View File

@ -36,13 +36,17 @@ DEVICEBAY_STATUS = """
INTERFACE_IPADDRESSES = """ INTERFACE_IPADDRESSES = """
<div class="table-badge-group"> <div class="table-badge-group">
{% for ip in value.all %} {% if value.count >= 3 %}
{% if ip.status != 'active' %} <a href="{% url 'ipam:ipaddress_list' %}?interface_id={{ record.pk }}">{{ value.count }}</a>
<a href="{{ ip.get_absolute_url }}" class="table-badge badge bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a> {% else %}
{% else %} {% for ip in value.all %}
<a href="{{ ip.get_absolute_url }}" class="table-badge">{{ ip }}</a> {% if ip.status != 'active' %}
{% endif %} <a href="{{ ip.get_absolute_url }}" class="table-badge badge bg-{{ ip.get_status_color }}" data-bs-toggle="tooltip" data-bs-placement="left" title="{{ ip.get_status_display }}">{{ ip }}</a>
{% endfor %} {% else %}
<a href="{{ ip.get_absolute_url }}" class="table-badge">{{ ip }}</a>
{% endif %}
{% endfor %}
{% endif %}
</div> </div>
""" """