Skip to content

Commit

Permalink
limits vlans on interface tables
Browse files Browse the repository at this point in the history
  • Loading branch information
thordreier committed Oct 2, 2024
1 parent 23f9483 commit 9495964
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions netbox/dcim/tables/template_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@

INTERFACE_TAGGED_VLANS = """
{% if record.mode == 'tagged' %}
{% if value.count > 3 %}
<a href="{{ record.get_absolute_url }}#vlans">{{ value.count }}</a>
{% else %}
{% for vlan in value.all %}
<a href="{{ vlan.get_absolute_url }}">{{ vlan }}</a><br />
{% endfor %}
{% endif %}
{% elif record.mode == 'tagged-all' %}
All
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion netbox/templates/dcim/interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ <h2 class="card-header">
</div>
</div>
<div class="row mb-3">
<div class="col col-md-12">
<div class="col col-md-12" id="vlans">
{% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion netbox/templates/virtualization/vminterface.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h2 class="card-header">
</div>
</div>
<div class="row mb-3">
<div class="col col-md-12">
<div class="col col-md-12" id="vlans">
{% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
</div>
</div>
Expand Down

0 comments on commit 9495964

Please sign in to comment.