devicerole.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load render_table from django_tables2 %}
  5. {% block breadcrumbs %}
  6. <li class="breadcrumb-item"><a href="{% url 'dcim:devicerole_list' %}">Device Roles</a></li>
  7. {% endblock %}
  8. {% block extra_controls %}
  9. {% if perms.dcim.add_device %}
  10. <a href="{% url 'dcim:device_add' %}?device_role={{ object.pk }}" class="btn btn-sm btn-primary">
  11. <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Device
  12. </a>
  13. {% endif %}
  14. {% endblock extra_controls %}
  15. {% block content %}
  16. <div class="row mb-3">
  17. <div class="col col-md-6">
  18. <div class="card">
  19. <h5 class="card-header">
  20. Device Role
  21. </h5>
  22. <div class="card-body">
  23. <table class="table table-hover attr-table">
  24. <tr>
  25. <th scope="row">Name</th>
  26. <td>{{ object.name }}</td>
  27. </tr>
  28. <tr>
  29. <th scope="row">Description</th>
  30. <td>{{ object.description|placeholder }}</td>
  31. </tr>
  32. <tr>
  33. <th scope="row">Color</th>
  34. <td>
  35. <span class="badge color-label" style="background-color: #{{ object.color }}">&nbsp;</span>
  36. </td>
  37. </tr>
  38. <tr>
  39. <th scope="row">VM Role</th>
  40. <td>{% checkmark object.vm_role %}</td>
  41. </tr>
  42. <tr>
  43. <th scope="row">Devices</th>
  44. <td>
  45. <a href="{% url 'dcim:device_list' %}?role_id={{ object.pk }}">{{ device_count }}</a>
  46. </td>
  47. </tr>
  48. <tr>
  49. <th>Virtual Machines</th>
  50. <td>
  51. {% if object.vm_role %}
  52. <a href="{% url 'virtualization:virtualmachine_list' %}?role_id={{ object.pk }}">{{ virtualmachine_count }}</a>
  53. {% else %}
  54. {{ ''|placeholder }}
  55. {% endif %}
  56. </td>
  57. </tr>
  58. </table>
  59. </div>
  60. </div>
  61. {% include 'inc/panels/tags.html' %}
  62. {% plugin_left_page object %}
  63. </div>
  64. <div class="col col-md-6">
  65. {% include 'inc/panels/custom_fields.html' %}
  66. {% plugin_right_page object %}
  67. </div>
  68. </div>
  69. <div class="row mb-3">
  70. <div class="col col-md-12">
  71. <div class="card">
  72. <h5 class="card-header">Devices</h5>
  73. <div class="card-body table-responsive">
  74. {% render_table devices_table 'inc/table.html' %}
  75. {% include 'inc/paginator.html' with paginator=devices_table.paginator page=devices_table.page %}
  76. </div>
  77. </div>
  78. {% plugin_full_width_page object %}
  79. </div>
  80. </div>
  81. {% endblock %}