|
@@ -328,6 +328,11 @@ class SiteView(generic.ObjectView):
|
|
|
'device_count',
|
|
'device_count',
|
|
|
cumulative=True
|
|
cumulative=True
|
|
|
).restrict(request.user, 'view').filter(site=instance)
|
|
).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)
|
|
asns = ASN.objects.restrict(request.user, 'view').filter(sites=instance)
|
|
|
asn_count = asns.count()
|
|
asn_count = asns.count()
|
|
@@ -338,6 +343,7 @@ class SiteView(generic.ObjectView):
|
|
|
'stats': stats,
|
|
'stats': stats,
|
|
|
'locations': locations,
|
|
'locations': locations,
|
|
|
'asns': asns,
|
|
'asns': asns,
|
|
|
|
|
+ 'nonracked_devices': nonracked_devices,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -415,11 +421,17 @@ class LocationView(generic.ObjectView):
|
|
|
).filter(pk__in=location_ids).exclude(pk=instance.pk)
|
|
).filter(pk__in=location_ids).exclude(pk=instance.pk)
|
|
|
child_locations_table = tables.LocationTable(child_locations)
|
|
child_locations_table = tables.LocationTable(child_locations)
|
|
|
paginate_table(child_locations_table, request)
|
|
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 {
|
|
return {
|
|
|
'rack_count': rack_count,
|
|
'rack_count': rack_count,
|
|
|
'device_count': device_count,
|
|
'device_count': device_count,
|
|
|
'child_locations_table': child_locations_table,
|
|
'child_locations_table': child_locations_table,
|
|
|
|
|
+ 'nonracked_devices': nonracked_devices,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|