mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Expanded device interfaces display to include MTU, MAC address, and tags
This commit is contained in:
parent
2fce7ebd8f
commit
7bed48f5fe
@ -858,8 +858,10 @@ class DeviceView(View):
|
|||||||
device.device_type.interface_ordering
|
device.device_type.interface_ordering
|
||||||
).select_related(
|
).select_related(
|
||||||
'connected_as_a__interface_b__device', 'connected_as_b__interface_a__device',
|
'connected_as_a__interface_b__device', 'connected_as_b__interface_a__device',
|
||||||
'circuit_termination__circuit'
|
'circuit_termination__circuit__provider'
|
||||||
).prefetch_related('ip_addresses')
|
).prefetch_related(
|
||||||
|
'tags', 'ip_addresses'
|
||||||
|
)
|
||||||
|
|
||||||
# Device bays
|
# Device bays
|
||||||
device_bays = natsorted(
|
device_bays = natsorted(
|
||||||
|
@ -525,6 +525,7 @@
|
|||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>LAG</th>
|
<th>LAG</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
|
<th>MTU</th>
|
||||||
<th>Mode</th>
|
<th>Mode</th>
|
||||||
<th colspan="2">Connection</th>
|
<th colspan="2">Connection</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<tr class="interface{% if not iface.enabled %} danger{% elif iface.connection and iface.connection.connection_status or iface.circuit_termination %} success{% elif iface.connection and not iface.connection.connection_status %} info{% elif iface.is_virtual %} warning{% endif %}" id="iface_{{ iface.name }}">
|
{% load helpers %}
|
||||||
|
<tr class="interface{% if not iface.enabled %} danger{% elif iface.connection and iface.connection.connection_status or iface.circuit_termination %} success{% elif iface.connection and not iface.connection.connection_status %} info{% elif iface.is_virtual %} warning{% endif %}" id="interface_{{ iface.name }}">
|
||||||
|
|
||||||
{# Checkbox #}
|
{# Checkbox #}
|
||||||
{% if perms.dcim.change_interface or perms.dcim.delete_interface %}
|
{% if perms.dcim.change_interface or perms.dcim.delete_interface %}
|
||||||
@ -7,32 +8,53 @@
|
|||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Icon and name #}
|
{# Icon/name/MAC #}
|
||||||
<td>
|
<td>
|
||||||
<span title="{{ iface.get_form_factor_display }}">
|
<span title="{{ iface.get_form_factor_display }}">
|
||||||
<i class="fa fa-fw fa-{% if iface.mgmt_only %}wrench{% elif iface.is_lag %}align-justify{% elif iface.is_virtual %}circle{% elif iface.is_wireless %}wifi{% else %}exchange{% endif %}"></i>
|
<i class="fa fa-fw fa-{% if iface.mgmt_only %}wrench{% elif iface.is_lag %}align-justify{% elif iface.is_virtual %}circle{% elif iface.is_wireless %}wifi{% else %}exchange{% endif %}"></i>
|
||||||
<a href="{{ iface.get_absolute_url }}">{{ iface }}</a>
|
<a href="{{ iface.get_absolute_url }}">{{ iface }}</a>
|
||||||
</span>
|
</span>
|
||||||
|
{% if iface.mac_address %}
|
||||||
|
<br/><small class="text-muted">{{ iface.mac_address }}</small>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{# LAG #}
|
{# LAG #}
|
||||||
<td>
|
<td>
|
||||||
{% if iface.lag %}
|
{% if iface.lag %}
|
||||||
<a href="#iface_{{ iface.lag }}" class="label label-default" title="{{ iface.lag.description }}">{{ iface.lag }}</a>
|
<a href="#interface_{{ iface.lag }}" class="label label-primary" title="{{ iface.lag.description }}">{{ iface.lag }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{# Description #}
|
{# Description/tags #}
|
||||||
<td>{{ iface.description|default:"—" }}</td>
|
<td>
|
||||||
|
{% if iface.description %}
|
||||||
|
{{ iface.description }}<br/>
|
||||||
|
{% endif %}
|
||||||
|
{% for tag in iface.tags.all %}
|
||||||
|
{% tag tag %}
|
||||||
|
{% empty %}
|
||||||
|
{% if not iface.description %}—{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
{# MTU #}
|
||||||
|
<td>{{ iface.mtu|default:"—" }}</td>
|
||||||
|
|
||||||
{# 802.1Q mode #}
|
{# 802.1Q mode #}
|
||||||
<td>{{ iface.get_mode_display }}</td>
|
<td>{{ iface.get_mode_display|default:"—" }}</td>
|
||||||
|
|
||||||
{# Connection or type #}
|
{# Connection or type #}
|
||||||
{% if iface.is_lag %}
|
{% if iface.is_lag %}
|
||||||
<td colspan="2" class="text-muted">
|
<td colspan="2" class="text-muted">
|
||||||
LAG interface<br />
|
LAG interface<br />
|
||||||
<small class="text-muted">{{ iface.member_interfaces.all|join:", "|default:"No members" }}</small>
|
<small class="text-muted">
|
||||||
|
{% for member in iface.member_interfaces.all %}
|
||||||
|
<a href="#interface_{{ member.name }}">{{ member }}</a>{% if not forloop.last %}, {% endif %}
|
||||||
|
{% empty %}
|
||||||
|
No members
|
||||||
|
{% endfor %}
|
||||||
|
</small>
|
||||||
</td>
|
</td>
|
||||||
{% elif iface.is_virtual %}
|
{% elif iface.is_virtual %}
|
||||||
<td colspan="2" class="text-muted">Virtual interface</td>
|
<td colspan="2" class="text-muted">Virtual interface</td>
|
||||||
@ -138,7 +160,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# IP addresses table #}
|
{# IP addresses table #}
|
||||||
<td colspan="7" style="padding: 0">
|
<td colspan="8" style="padding: 0">
|
||||||
<table class="table table-condensed interface-ips">
|
<table class="table table-condensed interface-ips">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="text-muted">
|
<tr class="text-muted">
|
||||||
|
Loading…
Reference in New Issue
Block a user