Added DeviceType to device bays table

This commit is contained in:
Jeremy Stretch 2016-07-05 13:42:14 -04:00
parent 06a38d836c
commit 7eae636562
2 changed files with 11 additions and 6 deletions

View File

@ -520,7 +520,7 @@ def device(request, pk):
.select_related('connected_as_a', 'connected_as_b', 'circuit') .select_related('connected_as_a', 'connected_as_b', 'circuit')
mgmt_interfaces = Interface.objects.filter(device=device, mgmt_only=True)\ mgmt_interfaces = Interface.objects.filter(device=device, mgmt_only=True)\
.select_related('connected_as_a', 'connected_as_b', 'circuit') .select_related('connected_as_a', 'connected_as_b', 'circuit')
device_bays = DeviceBay.objects.filter(device=device).select_related('installed_device') device_bays = DeviceBay.objects.filter(device=device).select_related('installed_device__device_type__manufacturer')
# Gather any secrets which belong to this device # Gather any secrets which belong to this device
secrets = device.secrets.all() secrets = device.secrets.all()

View File

@ -2,13 +2,18 @@
<td> <td>
<i class="fa fa-fw fa-{% if devicebay.installed_device %}dot-circle-o{% else %}circle-o{% endif %}"></i> {{ devicebay.name }} <i class="fa fa-fw fa-{% if devicebay.installed_device %}dot-circle-o{% else %}circle-o{% endif %}"></i> {{ devicebay.name }}
</td> </td>
<td> {% if devicebay.installed_device %}
{% if devicebay.installed_device %} <td>
<a href="{% url 'dcim:device' pk=devicebay.installed_device.pk %}">{{ devicebay.installed_device }}</a> <a href="{% url 'dcim:device' pk=devicebay.installed_device.pk %}">{{ devicebay.installed_device }}</a>
{% else %} </td>
<td>
<span>{{ devicebay.installed_device.device_type }}</span>
</td>
{% else %}
<td colspan="2">
<span class="text-muted">Vacant</span> <span class="text-muted">Vacant</span>
{% endif %} </td>
</td> {% endif %}
<td class="text-right"> <td class="text-right">
{% if perms.dcim.change_devicebay %} {% if perms.dcim.change_devicebay %}
{% if devicebay.installed_device %} {% if devicebay.installed_device %}