1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Sort device IPs by address rather than by interface

This commit is contained in:
Jeremy Stretch
2016-03-07 16:24:47 -05:00
parent 284256777f
commit 2098a152d8
2 changed files with 2 additions and 2 deletions

View File

@ -601,7 +601,7 @@ def device(request, pk):
secrets = device.secrets.all()
# Find all IP addresses assigned to this device
ip_addresses = IPAddress.objects.filter(interface__device=device).select_related('interface').order_by('interface')
ip_addresses = IPAddress.objects.filter(interface__device=device).select_related('interface').order_by('address')
# Find any related devices for convenient linking in the UI
related_devices = []

View File

@ -1,8 +1,8 @@
<tr>
<td>{{ ip.interface }}</td>
<td>
<a href="{% url 'ipam:ipaddress' pk=ip.pk %}">{{ ip }}</a>
</td>
<td>{{ ip.interface }}</td>
<td>
{% if device.primary_ip == ip %}
<span class="label label-success">Primary</span>