2021-03-26 14:44:43 -04:00
|
|
|
{% extends 'generic/object.html' %}
|
|
|
|
{% load helpers %}
|
|
|
|
{% load plugins %}
|
2021-12-13 15:36:51 -05:00
|
|
|
{% load render_table from django_tables2 %}
|
2021-03-26 14:44:43 -04:00
|
|
|
|
|
|
|
{% block breadcrumbs %}
|
2021-04-18 00:22:52 -07:00
|
|
|
<li class="breadcrumb-item"><a href="{% url 'dcim:devicerole_list' %}">Device Roles</a></li>
|
2021-03-26 14:44:43 -04:00
|
|
|
{% endblock %}
|
|
|
|
|
2021-12-15 10:34:20 -05:00
|
|
|
{% block extra_controls %}
|
|
|
|
{% if perms.dcim.add_device %}
|
|
|
|
<a href="{% url 'dcim:device_add' %}?device_role={{ object.pk }}" class="btn btn-sm btn-primary">
|
|
|
|
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Device
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock extra_controls %}
|
|
|
|
|
2021-03-26 14:44:43 -04:00
|
|
|
{% block content %}
|
2021-04-18 00:22:52 -07:00
|
|
|
<div class="row mb-3">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-6">
|
2021-04-18 00:22:52 -07:00
|
|
|
<div class="card">
|
|
|
|
<h5 class="card-header">
|
|
|
|
Device Role
|
|
|
|
</h5>
|
|
|
|
<div class="card-body">
|
|
|
|
<table class="table table-hover attr-table">
|
|
|
|
<tr>
|
|
|
|
<th scope="row">Name</th>
|
|
|
|
<td>{{ object.name }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">Description</th>
|
|
|
|
<td>{{ object.description|placeholder }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">Color</th>
|
|
|
|
<td>
|
|
|
|
<span class="badge color-label" style="background-color: #{{ object.color }}"> </span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">VM Role</th>
|
2021-12-29 10:26:42 -05:00
|
|
|
<td>{% checkmark object.vm_role %}</td>
|
2021-04-18 00:22:52 -07:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row">Devices</th>
|
|
|
|
<td>
|
2021-06-22 14:30:47 -04:00
|
|
|
<a href="{% url 'dcim:device_list' %}?role_id={{ object.pk }}">{{ device_count }}</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2021-07-20 21:09:13 -04:00
|
|
|
<th>Virtual Machines</th>
|
2021-06-22 14:30:47 -04:00
|
|
|
<td>
|
|
|
|
{% if object.vm_role %}
|
|
|
|
<a href="{% url 'virtualization:virtualmachine_list' %}?role_id={{ object.pk }}">{{ virtualmachine_count }}</a>
|
|
|
|
{% else %}
|
2022-06-15 22:33:21 +02:00
|
|
|
{{ ''|placeholder }}
|
2021-06-22 14:30:47 -04:00
|
|
|
{% endif %}
|
2021-04-18 00:22:52 -07:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2021-03-26 14:44:43 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-10-21 11:23:31 -04:00
|
|
|
{% include 'inc/panels/tags.html' %}
|
2021-03-26 14:44:43 -04:00
|
|
|
{% plugin_left_page object %}
|
|
|
|
</div>
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-6">
|
2021-10-19 14:21:31 -04:00
|
|
|
{% include 'inc/panels/custom_fields.html' %}
|
2021-03-26 14:44:43 -04:00
|
|
|
{% plugin_right_page object %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-04-18 00:22:52 -07:00
|
|
|
<div class="row mb-3">
|
2021-04-30 15:55:37 -07:00
|
|
|
<div class="col col-md-12">
|
2021-04-18 00:22:52 -07:00
|
|
|
<div class="card">
|
2021-12-15 10:34:20 -05:00
|
|
|
<h5 class="card-header">Devices</h5>
|
2021-12-13 15:36:51 -05:00
|
|
|
<div class="card-body table-responsive">
|
|
|
|
{% render_table devices_table 'inc/table.html' %}
|
2021-12-15 10:34:20 -05:00
|
|
|
{% include 'inc/paginator.html' with paginator=devices_table.paginator page=devices_table.page %}
|
2021-03-26 14:44:43 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% plugin_full_width_page object %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|