From 749fc31bc40f3f190f1e8351fc9637ea8e644797 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Fri, 19 Jan 2024 22:34:30 +0530 Subject: [PATCH] limits ip addresses on interface tables #14645 --- netbox/dcim/tables/template_code.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py index 1862893ff..3f8b63688 100644 --- a/netbox/dcim/tables/template_code.py +++ b/netbox/dcim/tables/template_code.py @@ -36,13 +36,17 @@ DEVICEBAY_STATUS = """ INTERFACE_IPADDRESSES = """
- {% for ip in value.all %} - {% if ip.status != 'active' %} - {{ ip }} - {% else %} - {{ ip }} - {% endif %} - {% endfor %} + {% if value.count >= 3 %} + {{ value.count }} + {% else %} + {% for ip in value.all %} + {% if ip.status != 'active' %} + {{ ip }} + {% else %} + {{ ip }} + {% endif %} + {% endfor %} + {% endif %}
"""