| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- {% extends 'generic/object.html' %}
- {% load helpers %}
- {% load plugins %}
- {% load tz %}
- {% block breadcrumbs %}
- {{ block.super }}
- {% if object.region %}
- {% for region in object.region.get_ancestors %}
- <li class="breadcrumb-item"><a href="{% url 'dcim:site_list' %}?region_id={{ region.pk }}">{{ region }}</a></li>
- {% endfor %}
- <li class="breadcrumb-item"><a href="{% url 'dcim:site_list' %}?region_id={{ object.region.pk }}">{{ object.region }}</a></li>
- {% elif object.group %}
- {% for group in object.group.get_ancestors %}
- <li class="breadcrumb-item"><a href="{% url 'dcim:site_list' %}?group_id={{ group.pk }}">{{ group }}</a></li>
- {% endfor %}
- <li class="breadcrumb-item"><a href="{% url 'dcim:site_list' %}?group_id={{ object.group.pk }}">{{ object.group }}</a></li>
- {% endif %}
- {% endblock %}
- {% block content %}
- <div class="row">
- <div class="col col-md-6">
- <div class="card">
- <h5 class="card-header">Site</h5>
- <div class="card-body">
- <table class="table table-hover attr-table">
- <tr>
- <th scope="row">Region</th>
- <td>
- {% if object.region %}
- {% for region in object.region.get_ancestors %}
- <a href="{{ region.get_absolute_url }}">{{ region }}</a> /
- {% endfor %}
- <a href="{{ object.region.get_absolute_url }}">{{ object.region }}</a>
- {% else %}
- <span class="text-muted">None</span>
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Group</th>
- <td>
- {% if object.group %}
- {% for group in object.group.get_ancestors %}
- <a href="{{ group.get_absolute_url }}">{{ group }}</a> /
- {% endfor %}
- <a href="{{ object.group.get_absolute_url }}">{{ object.group }}</a>
- {% else %}
- <span class="text-muted">None</span>
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Status</th>
- <td>
- <span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
- </td>
- </tr>
- <tr>
- <th scope="row">Tenant</th>
- <td>
- {% if object.tenant %}
- {% if object.tenant.group %}
- <a href="{{ object.tenant.group.get_absolute_url }}">{{ object.tenant.group }}</a> /
- {% endif %}
- <a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
- {% else %}
- <span class="text-muted">None</span>
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Facility</th>
- <td>{{ object.facility|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">Description</th>
- <td>{{ object.description|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">AS Number</th>
- <td>{{ object.asn|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">Time Zone</th>
- <td>
- {% if object.time_zone %}
- {{ object.time_zone }} (UTC {{ object.time_zone|tzoffset }})<br />
- <small class="text-muted">Site time: {% timezone object.time_zone %}{% annotated_now %}{% endtimezone %}</small>
- {% else %}
- <span class="text-muted">—</span>
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Physical Address</th>
- <td>
- {% if object.physical_address %}
- <div class="float-end noprint">
- <a href="{{ config.MAPS_URL }}{{ object.physical_address|urlencode }}" target="_blank" class="btn btn-primary btn-sm">
- <i class="mdi mdi-map-marker"></i> Map It
- </a>
- </div>
- <span>{{ object.physical_address|linebreaksbr }}</span>
- {% else %}
- <span class="text-muted">—</span>
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Shipping Address</th>
- <td>{{ object.shipping_address|linebreaksbr|placeholder }}</td>
- </tr>
- <tr>
- <th scope="row">GPS Coordinates</th>
- <td>
- {% if object.latitude and object.longitude %}
- <div class="float-end noprint">
- <a href="{{ config.MAPS_URL }}{{ object.latitude }},{{ object.longitude }}" target="_blank" class="btn btn-primary btn-sm">
- <i class="mdi mdi-map-marker"></i> Map It
- </a>
- </div>
- <span>{{ object.latitude }}, {{ object.longitude }}</span>
- {% else %}
- <span class="text-muted">—</span>
- {% endif %}
- </td>
- </tr>
- {# Legacy contact fields #}
- {% with deprecation_warning="This field will be removed in a future release. Please migrate this data to contact objects." %}
- {% if object.contact_name %}
- <tr>
- <th scope="row">Contact Name</th>
- <td>
- {% if object.contact_name %}
- <div class="float-end text-warning">
- <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
- </div>
- {% endif %}
- {{ object.contact_name|placeholder }}
- </td>
- </tr>
- {% endif %}
- {% if object.contact_phone %}
- <tr>
- <th scope="row">Contact Phone</th>
- <td>
- {% if object.contact_phone %}
- <div class="float-end text-warning">
- <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
- </div>
- <a href="tel:{{ object.contact_phone }}">{{ object.contact_phone }}</a>
- {% else %}
- <span class="text-muted">—</span>
- {% endif %}
- </td>
- </tr>
- {% endif %}
- {% if object.contact_email %}
- <tr>
- <th scope="row">Contact E-Mail</th>
- <td>
- {% if object.contact_email %}
- <div class="float-end text-warning">
- <i class="mdi mdi-alert" title="{{ deprecation_warning }}"></i>
- </div>
- <a href="mailto:{{ object.contact_email }}">{{ object.contact_email }}</a>
- {% else %}
- <span class="text-muted">—</span>
- {% endif %}
- </td>
- </tr>
- {% endif %}
- {% endwith %}
- </table>
- </div>
- </div>
- {% include 'inc/panels/custom_fields.html' %}
- {% include 'inc/panels/tags.html' %}
- {% include 'inc/panels/comments.html' %}
- {% plugin_left_page object %}
- </div>
- <div class="col col-md-6">
- <div class="card">
- <h5 class="card-header">Related Objects</h5>
- <div class="card-body">
- <table class="table table-hover attr-table">
- <tr>
- <th scope="row">Locations</th>
- <td class="text-end">
- {% if stats.location_count %}
- <a href="{% url 'dcim:location_list' %}?site_id={{ object.pk }}">{{ stats.location_count }}</a>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Racks</th>
- <td class="text-end">
- {% if stats.rack_count %}
- <div class="dropdown">
- <button class="btn btn-sm btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
- {{ stats.rack_count }}
- </button>
- <ul class="dropdown-menu">
- <li><a class="dropdown-item" href="{% url 'dcim:rack_list' %}?site_id={{ object.pk }}">View Racks</a></li>
- <li><a class="dropdown-item" href="{% url 'dcim:rack_elevation_list' %}?site_id={{ object.pk }}">View Elevations</a></li>
- </ul>
- </div>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Devices</th>
- <td class="text-end">
- {% if stats.device_count %}
- <a href="{% url 'dcim:device_list' %}?site_id={{ object.pk }}">{{ stats.device_count }}</a>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Virtual Machines</th>
- <td class="text-end">
- {% if stats.vm_count %}
- <a href="{% url 'virtualization:virtualmachine_list' %}?site_id={{ object.pk }}">{{ stats.vm_count }}</a>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Prefixes</th>
- <td class="text-end">
- {% if stats.prefix_count %}
- <a href="{% url 'ipam:prefix_list' %}?site_id={{ object.pk }}">{{ stats.prefix_count }}</a>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">VLANs</th>
- <td class="text-end">
- {% if stats.vlan_count %}
- <a href="{% url 'ipam:vlan_list' %}?site_id={{ object.pk }}">{{ stats.vlan_count }}</a>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">ASNs</th>
- <td class="text-end">
- {% if stats.asn_count %}
- <a href="{% url 'ipam:asn_list' %}?site_id={{ object.pk }}">{{ stats.asn_count }}</a>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- <tr>
- <th scope="row">Circuits</th>
- <td class="text-end">
- {% if stats.circuit_count %}
- <a href="{% url 'circuits:circuit_list' %}?site_id={{ object.pk }}">{{ stats.circuit_count }}</a>
- {% else %}
- {{ ''|placeholder }}
- {% endif %}
- </td>
- </tr>
- </table>
- </div>
- </div>
- {% include 'dcim/inc/nonracked_devices.html' %}
- {% include 'inc/panels/contacts.html' %}
- <div class="card">
- <h5 class="card-header">Locations</h5>
- <div class='card-body'>
- {% if locations %}
- <table class="table table-hover">
- <tr>
- <th>Location</th>
- <th>Racks</th>
- <th>Devices</th>
- <th></th>
- </tr>
- {% for location in locations %}
- <tr>
- <td>
- {% for i in location.level|as_range %}<i class="mdi mdi-circle-small"></i>{% endfor %}
- <a href="{{ location.get_absolute_url }}">{{ location }}</a>
- </td>
- <td>
- <a href="{% url 'dcim:rack_list' %}?location_id={{ location.pk }}">{{ location.rack_count }}</a>
- </td>
- <td>
- <a href="{% url 'dcim:device_list' %}?location_id={{ location.pk }}">{{ location.device_count }}</a>
- </td>
- <td class="text-end noprint">
- <a href="{% url 'dcim:rack_elevation_list' %}?location_id={{ location.pk }}" class="btn btn-sm btn-primary" title="View Elevations">
- <i class="mdi mdi-server"></i>
- </a>
- </td>
- </tr>
- {% endfor %}
- </table>
- {% else %}
- <span class="text-muted">None</span>
- {% endif %}
- </div>
- {% if perms.dcim.add_location %}
- <div class="card-footer text-end noprint">
- <a href="{% url 'dcim:location_add' %}?site={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
- <i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a location
- </a>
- </div>
- {% endif %}
- </div>
- <div class="card">
- <h5 class="card-header">ASNs</h5>
- <div class='card-body'>
- {% if asns %}
- <table class="table table-hover">
- <tr>
- <th>ASN</th>
- <th>Description</th>
- </tr>
- {% for asn in asns %}
- <tr>
- <td><a href="{{ asn.get_absolute_url }}">{{ asn }}</a></td>
- <td>{{ asn.description|placeholder }}</td>
- </tr>
- {% endfor %}
- </table>
- {% else %}
- <span class="text-muted">None</span>
- {% endif %}
- </div>
- {% if perms.ipam.add_asn %}
- <div class="card-footer text-end noprint">
- <a href="{% url 'ipam:asn_add' %}?sites={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
- <i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add an ASN
- </a>
- </div>
- {% endif %}
- </div>
- {% include 'inc/panels/image_attachments.html' %}
- {% plugin_right_page object %}
- </div>
- </div>
- <div class="row">
- <div class="col col-md-12">
- {% plugin_full_width_page object %}
- </div>
- </div>
- {% endblock %}
|