Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions netbox/dcim/models/device_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,10 @@ def is_wireless(self):
def is_lag(self):
return self.type == InterfaceTypeChoices.TYPE_LAG

@property
def is_bridge(self):
return self.type == InterfaceTypeChoices.TYPE_BRIDGE

@property
def link(self):
return self.cable or self.wireless_link
Expand Down
9 changes: 9 additions & 0 deletions netbox/dcim/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,14 @@ def get_extra_context(self, request, instance):
orderable=False
)

# Get bridge interfaces
bridge_interfaces = Interface.objects.restrict(request.user, 'view').filter(bridge=instance)
bridge_interfaces_tables = tables.InterfaceTable(
bridge_interfaces,
exclude=('device', 'parent'),
orderable=False
)

# Get child interfaces
child_interfaces = Interface.objects.restrict(request.user, 'view').filter(parent=instance)
child_interfaces_tables = tables.InterfaceTable(
Expand All @@ -1800,6 +1808,7 @@ def get_extra_context(self, request, instance):

return {
'ipaddress_table': ipaddress_table,
'bridge_interfaces_table': bridge_interfaces_tables,
'child_interfaces_table': child_interfaces_tables,
'vlan_table': vlan_table,
}
Expand Down
7 changes: 7 additions & 0 deletions netbox/templates/dcim/interface.html
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@ <h5 class="card-header">
{% include 'inc/panel_table.html' with table=vlan_table heading="VLANs" %}
</div>
</div>
{% if object.is_bridge %}
<div class="row mb-3">
<div class="col col-md-12">
{% include 'inc/panel_table.html' with table=bridge_interfaces_table heading="Bridge Interfaces" %}
</div>
</div>
{% endif %}
<div class="row mb-3">
<div class="col col-md-12">
{% include 'inc/panel_table.html' with table=child_interfaces_table heading="Child Interfaces" %}
Expand Down