-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: #8457 - implement nonracked devices on locations and sites
- Loading branch information
Showing
5 changed files
with
77 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% load helpers %} | ||
|
||
<div class="card"> | ||
<h5 class="card-header"> | ||
Non-Racked Devices | ||
</h5> | ||
<div class="card-body"> | ||
{% if nonracked_devices %} | ||
<table class="table table-hover"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Role</th> | ||
<th>Type</th> | ||
<th colspan="2">Parent Device</th> | ||
</tr> | ||
{% for device in nonracked_devices %} | ||
<tr{% if device.device_type.u_height %} class="warning"{% endif %}> | ||
<td> | ||
<a href="{% url 'dcim:device' pk=device.pk %}">{{ device }}</a> | ||
</td> | ||
<td>{{ device.device_role }}</td> | ||
<td>{{ device.device_type }}</td> | ||
{% if device.parent_bay %} | ||
<td><a href="{{ device.parent_bay.device.get_absolute_url }}">{{ device.parent_bay.device }}</a></td> | ||
<td>{{ device.parent_bay }}</td> | ||
{% else %} | ||
<td colspan="2" class="text-muted">—</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
{% else %} | ||
<div class="text-muted"> | ||
None | ||
</div> | ||
{% endif %} | ||
</div> | ||
{% if perms.dcim.add_device %} | ||
{% if object|meta:'verbose_name' == 'rack' %} | ||
<div class="card-footer text-end noprint"> | ||
<a href="{% url 'dcim:device_add' %}?site={{ object.site.pk }}&rack={{ 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> | ||
{% elif object|meta:'verbose_name' == 'site' %} | ||
<div class="card-footer text-end noprint"> | ||
<a href="{% url 'dcim:device_add' %}?site={{ 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> | ||
{% elif object|meta:'verbose_name' == 'location' %} | ||
<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 %} | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters