mirror of
				https://github.com/netbox-community/netbox.git
				synced 2024-05-10 07:54:54 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			254 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			254 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% extends 'generic/object.html' %}
 | 
						|
{% load helpers %}
 | 
						|
{% load plugins %}
 | 
						|
{% load tz %}
 | 
						|
 | 
						|
{% block breadcrumbs %}
 | 
						|
  <li class="breadcrumb-item"><a href="{% url 'dcim:site_list' %}">Sites</a></li>
 | 
						|
  {% if object.region %}
 | 
						|
    {% for region in object.region.get_ancestors %}
 | 
						|
      <li class="breadcrumb-item"><a href="{{ region.get_absolute_url }}">{{ region }}</a></li>
 | 
						|
    {% endfor %}
 | 
						|
    <li class="breadcrumb-item"><a href="{{ object.region.get_absolute_url }}">{{ object.region }}</a></li>
 | 
						|
  {% endif %}
 | 
						|
  <li class="breadcrumb-item">{{ object }}</li>
 | 
						|
{% endblock %}
 | 
						|
 | 
						|
{% block content %}
 | 
						|
<div class="row">
 | 
						|
	<div class="col-md-7">
 | 
						|
        <div class="card">
 | 
						|
            <h5 class="card-header">
 | 
						|
                Site
 | 
						|
            </h5>
 | 
						|
            <div class="card-body">
 | 
						|
                <table class="table table-hover attr-table">
 | 
						|
                    <tr>
 | 
						|
                        <td colspan="2">
 | 
						|
                        <span class="badge bg-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
 | 
						|
                        </td>
 | 
						|
 | 
						|
                    </tr>
 | 
						|
                    <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">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">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 %}{% now "SHORT_DATETIME_FORMAT" %}{% endtimezone %}</small>
 | 
						|
                            {% else %}
 | 
						|
                                <span class="text-muted">—</span>
 | 
						|
                            {% endif %}
 | 
						|
                        </td>
 | 
						|
                    </tr>
 | 
						|
                    <tr>
 | 
						|
                        <th scope="row">Description</th>
 | 
						|
                        <td>{{ object.description|placeholder }}</td>
 | 
						|
                    </tr>
 | 
						|
                </table>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
        <div class="card">
 | 
						|
            <h5 class="card-header">
 | 
						|
                Contact Info
 | 
						|
            </h5>
 | 
						|
            <div class="card-body">
 | 
						|
                <table class="table table-hover attr-table">
 | 
						|
                    <tr>
 | 
						|
                        <th scope="row">Physical Address</th>
 | 
						|
                        <td>
 | 
						|
                            {% if object.physical_address %}
 | 
						|
                                <div class="float-end noprint">
 | 
						|
                                    <a href="{{ settings.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.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="{{ settings.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>
 | 
						|
                    <tr>
 | 
						|
                        <th scope="row">Contact Name</th>
 | 
						|
                        <td>{{ object.contact_name|placeholder }}</td>
 | 
						|
                    </tr>
 | 
						|
                    <tr>
 | 
						|
                        <th scope="row">Contact Phone</th>
 | 
						|
                        <td>
 | 
						|
                            {% if object.contact_phone %}
 | 
						|
                                <a href="tel:{{ object.contact_phone }}">{{ object.contact_phone }}</a>
 | 
						|
                            {% else %}
 | 
						|
                                <span class="text-muted">—</span>
 | 
						|
                            {% endif %}
 | 
						|
                        </td>
 | 
						|
                    </tr>
 | 
						|
                    <tr>
 | 
						|
                        <th scope="row">Contact E-Mail</th>
 | 
						|
                        <td>
 | 
						|
                            {% if object.contact_email %}
 | 
						|
                                <a href="mailto:{{ object.contact_email }}">{{ object.contact_email }}</a>
 | 
						|
                            {% else %}
 | 
						|
                                <span class="text-muted">—</span>
 | 
						|
                            {% endif %}
 | 
						|
                        </td>
 | 
						|
                    </tr>
 | 
						|
                </table>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
        {% include 'inc/custom_fields_panel.html' %}
 | 
						|
        {% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='dcim:site_list' %}
 | 
						|
        <div class="card">
 | 
						|
            <h5 class="card-header">
 | 
						|
                Comments
 | 
						|
            </h5>
 | 
						|
            <div class="card-body rendered-markdown">
 | 
						|
                {% if object.comments %}
 | 
						|
                    {{ object.comments|render_markdown }}
 | 
						|
                {% else %}
 | 
						|
                    <span class="text-muted">None</span>
 | 
						|
                {% endif %}
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
        {% plugin_left_page object %}
 | 
						|
    </div>
 | 
						|
    <div class="col-md-5">
 | 
						|
        <div class="card">
 | 
						|
            <h5 class="card-header">
 | 
						|
                Stats
 | 
						|
            </h5>
 | 
						|
            <div class="card-body">
 | 
						|
                <div class="row">
 | 
						|
                    <div class="col-md-4 text-center">
 | 
						|
                        <h2><a href="{% url 'dcim:rack_list' %}?site_id={{ object.pk }}" class="btn {% if stats.rack_count %}btn-primary{% else %}btn-outline-dark{% endif %} btn-lg">{{ stats.rack_count }}</a></h2>
 | 
						|
                        <p>Racks</p>
 | 
						|
                    </div>
 | 
						|
                    <div class="col-md-4 text-center">
 | 
						|
                        <h2><a href="{% url 'dcim:device_list' %}?site_id={{ object.pk }}" class="btn {% if stats.device_count %}btn-primary{% else %}btn-outline-dark{% endif %} btn-lg">{{ stats.device_count }}</a></h2>
 | 
						|
                        <p>Devices</p>
 | 
						|
                    </div>
 | 
						|
                    <div class="col-md-4 text-center">
 | 
						|
                        <h2><a href="{% url 'ipam:prefix_list' %}?site_id={{ object.pk }}" class="btn {% if stats.prefix_count %}btn-primary{% else %}btn-outline-dark{% endif %} btn-lg">{{ stats.prefix_count }}</a></h2>
 | 
						|
                        <p>Prefixes</p>
 | 
						|
                    </div>
 | 
						|
                    <div class="col-md-4 text-center">
 | 
						|
                        <h2><a href="{% url 'ipam:vlan_list' %}?site_id={{ object.pk }}" class="btn {% if stats.vlan_count %}btn-primary{% else %}btn-outline-dark{% endif %} btn-lg">{{ stats.vlan_count }}</a></h2>
 | 
						|
                        <p>VLANs</p>
 | 
						|
                    </div>
 | 
						|
                    <div class="col-md-4 text-center">
 | 
						|
                        <h2><a href="{% url 'circuits:circuit_list' %}?site_id={{ object.pk }}" class="btn {% if stats.circuit_count %}btn-primary{% else %}btn-outline-dark{% endif %} btn-lg">{{ stats.circuit_count }}</a></h2>
 | 
						|
                        <p>Circuits</p>
 | 
						|
                    </div>
 | 
						|
                    <div class="col-md-4 text-center">
 | 
						|
                        <h2><a href="{% url 'virtualization:virtualmachine_list' %}?site_id={{ object.pk }}" class="btn {% if stats.vm_count %}btn-primary{% else %}btn-outline-dark{% endif %} btn-lg">{{ stats.vm_count }}</a></h2>
 | 
						|
                        <p>Virtual Machines</p>
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
        <div class="card">
 | 
						|
            <h5 class="card-header">
 | 
						|
                Locations
 | 
						|
            </h5>
 | 
						|
            <div class='card-body'>
 | 
						|
                <table class="table table-hover">
 | 
						|
                    {% for location in locations %}
 | 
						|
                        <tr>
 | 
						|
                            <td style="padding-left: {{ location.level }}8px">
 | 
						|
                                <i class="mdi mdi-folder-open"></i>
 | 
						|
                                <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>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
        <div class="card">
 | 
						|
            <h5 class="card-header">
 | 
						|
                Images
 | 
						|
            </h5>
 | 
						|
            <div class="card-body">
 | 
						|
            {% include 'inc/image_attachments.html' with images=object.images.all %}
 | 
						|
            </div>
 | 
						|
            {% if perms.extras.add_imageattachment %}
 | 
						|
                <div class="card-footer text-end noprint">
 | 
						|
                    <a href="{% url 'dcim:site_add_image' object_id=object.pk %}" class="btn btn-primary btn-sm">
 | 
						|
                        <span class="bi bi-plus" aria-hidden="true"></span>
 | 
						|
                        Attach an image
 | 
						|
                    </a>
 | 
						|
                </div>
 | 
						|
            {% endif %}
 | 
						|
        </div>
 | 
						|
        {% plugin_right_page object %}
 | 
						|
	</div>
 | 
						|
</div>
 | 
						|
<div class="row">
 | 
						|
    <div class="col-md-12">
 | 
						|
        {% plugin_full_width_page object %}
 | 
						|
    </div>
 | 
						|
</div>
 | 
						|
{% endblock %}
 |