From 9495964987844374ca8557d343a230133e94ba3d Mon Sep 17 00:00:00 2001
From: Thor Dreier-Hansen <43479811+thordreier@users.noreply.github.com>
Date: Wed, 2 Oct 2024 11:19:22 +0200
Subject: [PATCH] limits vlans on interface tables
---
netbox/dcim/tables/template_code.py | 4 ++++
netbox/templates/dcim/interface.html | 2 +-
netbox/templates/virtualization/vminterface.html | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py
index d3134656ce..ee0956f2cc 100644
--- a/netbox/dcim/tables/template_code.py
+++ b/netbox/dcim/tables/template_code.py
@@ -56,9 +56,13 @@
INTERFACE_TAGGED_VLANS = """
{% if record.mode == 'tagged' %}
+ {% if value.count > 3 %}
+ {{ value.count }}
+ {% else %}
{% for vlan in value.all %}
{{ vlan }}
{% endfor %}
+ {% endif %}
{% elif record.mode == 'tagged-all' %}
All
{% endif %}
diff --git a/netbox/templates/dcim/interface.html b/netbox/templates/dcim/interface.html
index 016a6c8906..6aa90a154b 100644
--- a/netbox/templates/dcim/interface.html
+++ b/netbox/templates/dcim/interface.html
@@ -351,7 +351,7 @@