mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-24 08:25:17 -06:00
Clean up location and device tables
This commit is contained in:
parent
211eed4845
commit
1402d26727
@ -71,30 +71,33 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col col-md-12">
|
<div class="col col-md-12">
|
||||||
<div class="card">
|
|
||||||
<h5 class="card-header">
|
|
||||||
Non-Racked Devices
|
|
||||||
</h5>
|
|
||||||
<div class="card-body htmx-container table-responsive"
|
|
||||||
hx-get="{% url 'dcim:device_list' %}?location_id={{ object.pk }}&rack_id=null&parent_bay_id=null"
|
|
||||||
hx-trigger="load"
|
|
||||||
></div>
|
|
||||||
|
|
||||||
{% if perms.dcim.add_device %}
|
|
||||||
<div class="card-footer text-end noprint">
|
|
||||||
<a href="{% url 'dcim:device_add' %}?site={{ object.site.pk }}&location={{ object.pk }}" class="btn btn-primary btn-sm">
|
|
||||||
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
|
|
||||||
Add a Non-Racked Device
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h5 class="card-header">Child Locations</h5>
|
<h5 class="card-header">Child Locations</h5>
|
||||||
<div class="card-body htmx-container table-responsive"
|
<div class="card-body htmx-container table-responsive"
|
||||||
hx-get="{% url 'dcim:location_list' %}?parent_id={{ object.pk }}"
|
hx-get="{% url 'dcim:location_list' %}?parent_id={{ object.pk }}"
|
||||||
hx-trigger="load"
|
hx-trigger="load"
|
||||||
></div>
|
></div>
|
||||||
|
{% if perms.dcim.add_location %}
|
||||||
|
<div class="card-footer text-end noprint">
|
||||||
|
<a href="{% url 'dcim:location_add' %}?site={{ object.site.pk }}&parent={{ 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">Non-Racked Devices</h5>
|
||||||
|
<div class="card-body htmx-container table-responsive"
|
||||||
|
hx-get="{% url 'dcim:device_list' %}?location_id={{ object.pk }}&rack_id=null&parent_bay_id=null"
|
||||||
|
hx-trigger="load"
|
||||||
|
></div>
|
||||||
|
{% if perms.dcim.add_device %}
|
||||||
|
<div class="card-footer text-end noprint">
|
||||||
|
<a href="{% url 'dcim:device_add' %}?site={{ object.site.pk }}&location={{ 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 Device
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% plugin_full_width_page object %}
|
{% plugin_full_width_page object %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -131,49 +131,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col col-md-6">
|
<div class="col col-md-6">
|
||||||
{% include 'inc/panels/related_objects.html' with filter_name='site_id' %}
|
{% include 'inc/panels/related_objects.html' with filter_name='site_id' %}
|
||||||
<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 %}
|
|
||||||
{{ location|linkify }}
|
|
||||||
</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>
|
|
||||||
{% include 'inc/panels/image_attachments.html' %}
|
{% include 'inc/panels/image_attachments.html' %}
|
||||||
{% plugin_right_page object %}
|
{% plugin_right_page object %}
|
||||||
</div>
|
</div>
|
||||||
@ -189,28 +146,24 @@
|
|||||||
{% if perms.dcim.add_location %}
|
{% if perms.dcim.add_location %}
|
||||||
<div class="card-footer text-end noprint">
|
<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">
|
<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
|
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a Location
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h5 class="card-header">
|
<h5 class="card-header">Non-Racked Devices</h5>
|
||||||
Non-Racked Devices
|
<div class="card-body htmx-container table-responsive"
|
||||||
</h5>
|
hx-get="{% url 'dcim:device_list' %}?site_id={{ object.pk }}&rack_id=null&parent_bay_id=null"
|
||||||
<div class="card-body htmx-container table-responsive"
|
hx-trigger="load"
|
||||||
hx-get="{% url 'dcim:device_list' %}?site_id={{ object.pk }}&rack_id=null&parent_bay_id=null"
|
></div>
|
||||||
hx-trigger="load"
|
{% if perms.dcim.add_device %}
|
||||||
></div>
|
<div class="card-footer text-end noprint">
|
||||||
|
<a href="{% url 'dcim:device_add' %}?site={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-sm">
|
||||||
{% if perms.dcim.add_device %}
|
<i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add a Device
|
||||||
<div class="card-footer text-end noprint">
|
</a>
|
||||||
<a href="{% url 'dcim:device_add' %}?site={{ object.pk }}" class="btn btn-primary btn-sm">
|
</div>
|
||||||
<i class="mdi mdi-plus-thick" aria-hidden="true"></i>
|
{% endif %}
|
||||||
Add a Non-Racked Device
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
{% plugin_full_width_page object %}
|
{% plugin_full_width_page object %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user