diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index e353f24d0..b1a53e93c 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -312,6 +312,7 @@ class SiteView(generic.ObjectView): def get_extra_context(self, request, instance): stats = { + 'location_count': Location.objects.restrict(request.user, 'view').filter(site=instance).count(), 'rack_count': Rack.objects.restrict(request.user, 'view').filter(site=instance).count(), 'device_count': Device.objects.restrict(request.user, 'view').filter(site=instance).count(), 'prefix_count': Prefix.objects.restrict(request.user, 'view').filter(site=instance).count(), diff --git a/netbox/templates/dcim/site.html b/netbox/templates/dcim/site.html index b895d3cec..2ad970301 100644 --- a/netbox/templates/dcim/site.html +++ b/netbox/templates/dcim/site.html @@ -20,266 +20,286 @@ {% block content %}
| Region | -- {% if object.region %} - {% for region in object.region.get_ancestors %} - {{ region }} / - {% endfor %} - {{ object.region }} - {% else %} - None - {% endif %} - | -
|---|---|
| Group | -- {% if object.group %} - {% for group in object.group.get_ancestors %} - {{ group }} / - {% endfor %} - {{ object.group }} - {% else %} - None - {% endif %} - | -
| Status | -- {{ object.get_status_display }} - | -
| Tenant | -- {% if object.tenant %} - {% if object.tenant.group %} - {{ object.tenant.group }} / - {% endif %} - {{ object.tenant }} - {% else %} - None - {% endif %} - | -
| Facility | -{{ object.facility|placeholder }} | -
| Description | -{{ object.description|placeholder }} | -
| AS Number | -{{ object.asn|placeholder }} | -
| Time Zone | -
- {% if object.time_zone %}
- {{ object.time_zone }} (UTC {{ object.time_zone|tzoffset }}) - Site time: {% timezone object.time_zone %}{% annotated_now %}{% endtimezone %} - {% else %} - — - {% endif %} - |
-
| Physical Address | -- {% if object.physical_address %} - - {{ object.physical_address|linebreaksbr }} - {% else %} - — - {% endif %} - | -
|---|---|
| Shipping Address | -{{ object.shipping_address|linebreaksbr|placeholder }} | -
| GPS Coordinates | -- {% if object.latitude and object.longitude %} - - {{ object.latitude }}, {{ object.longitude }} - {% else %} - — - {% endif %} - | -
| Contact Name | -
- {% if object.contact_name %}
-
-
-
- {% endif %}
- {{ object.contact_name|placeholder }}
- |
-
| Contact Phone | -
- {% if object.contact_phone %}
-
-
-
- {{ object.contact_phone }}
- {% else %}
- —
- {% endif %}
- |
-
| Contact E-Mail | -
- {% if object.contact_email %}
-
-
-
- {{ object.contact_email }}
- {% else %}
- —
- {% endif %}
- |
-
Racks
-Devices
-Prefixes
-VLANs
-Circuits
-Virtual Machines
-ASNs
-| Location | -Racks | -Devices | -- |
|---|---|---|---|
| - {% for i in location.level|as_range %}{% endfor %} - {{ location }} - | -- {{ location.rack_count }} - | -- {{ location.device_count }} - | - -
| Region | ++ {% if object.region %} + {% for region in object.region.get_ancestors %} + {{ region }} / {% endfor %} + {{ object.region }} {% else %} None {% endif %} + | +
|---|---|
| Group | ++ {% if object.group %} + {% for group in object.group.get_ancestors %} + {{ group }} / + {% endfor %} + {{ object.group }} + {% else %} + None + {% endif %} + | +
| Status | ++ {{ object.get_status_display }} + | +
| Tenant | ++ {% if object.tenant %} + {% if object.tenant.group %} + {{ object.tenant.group }} / + {% endif %} + {{ object.tenant }} + {% else %} + None + {% endif %} + | +
| Facility | +{{ object.facility|placeholder }} | +
| Description | +{{ object.description|placeholder }} | +
| AS Number | +{{ object.asn|placeholder }} | +
| Time Zone | +
+ {% if object.time_zone %}
+ {{ object.time_zone }} (UTC {{ object.time_zone|tzoffset }}) + Site time: {% timezone object.time_zone %}{% annotated_now %}{% endtimezone %} + {% else %} + — + {% endif %} + |
+
| Physical Address | ++ {% if object.physical_address %} + + {{ object.physical_address|linebreaksbr }} + {% else %} + — + {% endif %} + | +
| Shipping Address | +{{ object.shipping_address|linebreaksbr|placeholder }} | +
| GPS Coordinates | ++ {% if object.latitude and object.longitude %} + + {{ object.latitude }}, {{ object.longitude }} + {% else %} + — + {% endif %} + | +
| Contact Name | +
+ {% if object.contact_name %}
+
+
+
+ {% endif %}
+ {{ object.contact_name|placeholder }}
+ |
+
| Contact Phone | +
+ {% if object.contact_phone %}
+
+
+
+ {{ object.contact_phone }}
+ {% else %}
+ —
+ {% endif %}
+ |
+
| Contact E-Mail | +
+ {% if object.contact_email %}
+
+
+
+ {{ object.contact_email }}
+ {% else %}
+ —
+ {% endif %}
+ |
+
Locations
Racks
+Devices
+Prefixes
+VLANs
+Circuits
+Virtual Machines
+ASNs
+| Location | +Racks | +Devices | ++ |
|---|---|---|---|
| + {% for i in location.level|as_range %}{% endfor %} + {{ location }} + | ++ {{ location.rack_count }} + | ++ {{ location.device_count }} + | + +
| ASN | +Description | +
|---|---|
| {{ asn }} | +{{ asn.description|placeholder }} | +