diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py
index cee516f5c5a..87c4828d554 100644
--- a/netbox/dcim/views.py
+++ b/netbox/dcim/views.py
@@ -328,6 +328,11 @@ def get_extra_context(self, request, instance):
'device_count',
cumulative=True
).restrict(request.user, 'view').filter(site=instance)
+ nonracked_devices = Device.objects.filter(
+ site=instance,
+ position__isnull=True,
+ parent_bay__isnull=True
+ ).prefetch_related('device_type__manufacturer')
asns = ASN.objects.restrict(request.user, 'view').filter(sites=instance)
asn_count = asns.count()
@@ -338,6 +343,7 @@ def get_extra_context(self, request, instance):
'stats': stats,
'locations': locations,
'asns': asns,
+ 'nonracked_devices': nonracked_devices,
}
@@ -415,11 +421,17 @@ def get_extra_context(self, request, instance):
).filter(pk__in=location_ids).exclude(pk=instance.pk)
child_locations_table = tables.LocationTable(child_locations)
paginate_table(child_locations_table, request)
+ nonracked_devices = Device.objects.filter(
+ location=instance,
+ position__isnull=True,
+ parent_bay__isnull=True
+ ).prefetch_related('device_type__manufacturer')
return {
'rack_count': rack_count,
'device_count': device_count,
'child_locations_table': child_locations_table,
+ 'nonracked_devices': nonracked_devices,
}
diff --git a/netbox/templates/dcim/inc/nonracked_devices.html b/netbox/templates/dcim/inc/nonracked_devices.html
new file mode 100644
index 00000000000..f1b669eb98d
--- /dev/null
+++ b/netbox/templates/dcim/inc/nonracked_devices.html
@@ -0,0 +1,62 @@
+{% load helpers %}
+
+
+
+
+{% if nonracked_devices %}
+
+
+ | Name |
+ Role |
+ Type |
+ Parent Device |
+
+ {% for device in nonracked_devices %}
+
+ |
+ {{ device }}
+ |
+ {{ device.device_role }} |
+ {{ device.device_type }} |
+ {% if device.parent_bay %}
+ {{ device.parent_bay.device }} |
+ {{ device.parent_bay }} |
+ {% else %}
+ — |
+ {% endif %}
+
+ {% endfor %}
+
+ {% else %}
+
+ None
+
+ {% endif %}
+
+ {% if perms.dcim.add_device %}
+ {% if object|meta:'verbose_name' == 'rack' %}
+
+ {% elif object|meta:'verbose_name' == 'site' %}
+
+ {% elif object|meta:'verbose_name' == 'location' %}
+
+ {% endif %}
+ {% endif %}
+
\ No newline at end of file
diff --git a/netbox/templates/dcim/location.html b/netbox/templates/dcim/location.html
index b684385a771..43bbfd114e9 100644
--- a/netbox/templates/dcim/location.html
+++ b/netbox/templates/dcim/location.html
@@ -90,6 +90,7 @@