mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
limits vlans on interface tables (#17662)
* limits vlans on interface tables * limits vlans on interface tables * limits vlans on interface tables * limits vlans on interface tables
This commit is contained in:
parent
4b6e8a9e75
commit
364826d2d8
@ -588,6 +588,9 @@ class BaseInterfaceTable(NetBoxTable):
|
|||||||
def value_ip_addresses(self, value):
|
def value_ip_addresses(self, value):
|
||||||
return ",".join([str(obj.address) for obj in value.all()])
|
return ",".join([str(obj.address) for obj in value.all()])
|
||||||
|
|
||||||
|
def value_tagged_vlans(self, value):
|
||||||
|
return ",".join([str(obj) for obj in value.all()])
|
||||||
|
|
||||||
|
|
||||||
class InterfaceTable(ModularDeviceComponentTable, BaseInterfaceTable, PathEndpointTable):
|
class InterfaceTable(ModularDeviceComponentTable, BaseInterfaceTable, PathEndpointTable):
|
||||||
device = tables.Column(
|
device = tables.Column(
|
||||||
|
@ -56,9 +56,13 @@ INTERFACE_FHRPGROUPS = """
|
|||||||
|
|
||||||
INTERFACE_TAGGED_VLANS = """
|
INTERFACE_TAGGED_VLANS = """
|
||||||
{% if record.mode == 'tagged' %}
|
{% if record.mode == 'tagged' %}
|
||||||
|
{% if value.count > 3 %}
|
||||||
|
<a href="{% url 'ipam:vlan_list' %}?{{ record|meta:"model_name" }}_id={{ record.pk }}">{{ value.count }} VLANs</a>
|
||||||
|
{% else %}
|
||||||
{% for vlan in value.all %}
|
{% for vlan in value.all %}
|
||||||
<a href="{{ vlan.get_absolute_url }}">{{ vlan }}</a><br />
|
<a href="{{ vlan.get_absolute_url }}">{{ vlan }}</a><br />
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% elif record.mode == 'tagged-all' %}
|
{% elif record.mode == 'tagged-all' %}
|
||||||
All
|
All
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user