module.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. {% extends 'generic/object.html' %}
  2. {% load helpers %}
  3. {% load plugins %}
  4. {% load tz %}
  5. {% block breadcrumbs %}
  6. {{ block.super }}
  7. <li class="breadcrumb-item">
  8. <a href="{% url 'dcim:module_list' %}?module_type_id={{ object.module_type.pk }}">{{ object.module_type }}</a>
  9. </li>
  10. {% endblock %}
  11. {% block extra_controls %}
  12. {% if perms.dcim.change_module %}
  13. <div class="dropdown">
  14. <button id="add-components" type="button" class="btn btn-sm btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
  15. <i class="mdi mdi-plus-thick" aria-hidden="true"></i> Add Components
  16. </button>
  17. <ul class="dropdown-menu" aria-labeled-by="add-components">
  18. {% if perms.dcim.add_consoleport %}
  19. <li><a class="dropdown-item" href="{% url 'dcim:consoleport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_consoleports' pk=object.pk %}">Console Ports</a></li>
  20. {% endif %}
  21. {% if perms.dcim.add_consoleserverport %}
  22. <li><a class="dropdown-item" href="{% url 'dcim:consoleserverport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_consoleserverports' pk=object.pk %}">Console Server Ports</a></li>
  23. {% endif %}
  24. {% if perms.dcim.add_powerport %}
  25. <li><a class="dropdown-item" href="{% url 'dcim:powerport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_powerports' pk=object.pk %}">Power Ports</a></li>
  26. {% endif %}
  27. {% if perms.dcim.add_poweroutlet %}
  28. <li><a class="dropdown-item" href="{% url 'dcim:poweroutlet_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_poweroutlets' pk=object.pk %}">Power Outlets</a></li>
  29. {% endif %}
  30. {% if perms.dcim.add_interface %}
  31. <li><a class="dropdown-item" href="{% url 'dcim:interface_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_interfaces' pk=object.pk %}">Interfaces</a></li>
  32. {% endif %}
  33. {% if perms.dcim.add_frontport %}
  34. <li><a class="dropdown-item" href="{% url 'dcim:frontport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_frontports' pk=object.pk %}">Front Ports</a></li>
  35. {% endif %}
  36. {% if perms.dcim.add_rearport %}
  37. <li><a class="dropdown-item" href="{% url 'dcim:rearport_add' %}?device={{ object.device.pk }}&module={{ object.pk }}&return_url={% url 'dcim:device_rearports' pk=object.pk %}">Rear Ports</a></li>
  38. {% endif %}
  39. </ul>
  40. </div>
  41. {% endif %}
  42. {% endblock %}
  43. {% block content %}
  44. <div class="row">
  45. <div class="col col-md-6">
  46. <div class="card">
  47. <h5 class="card-header">Module</h5>
  48. <div class="card-body">
  49. <table class="table table-hover attr-table">
  50. <tr>
  51. <th scope="row">Device</th>
  52. <td>{{ object.device|linkify }}</td>
  53. </tr>
  54. <tr>
  55. <th scope="row">Device Type</th>
  56. <td>{{ object.device.device_type|linkify }}</td>
  57. </tr>
  58. <tr>
  59. <th scope="row">Module Type</th>
  60. <td>{{ object.module_type|linkify }}</td>
  61. </tr>
  62. <tr>
  63. <th scope="row">Serial Number</th>
  64. <td class="font-monospace">{{ object.serial|placeholder }}</td>
  65. </tr>
  66. <tr>
  67. <th scope="row">Asset Tag</th>
  68. <td class="font-monospace">{{ object.asset_tag|placeholder }}</td>
  69. </tr>
  70. </table>
  71. </div>
  72. </div>
  73. {% include 'inc/panels/custom_fields.html' %}
  74. {% include 'inc/panels/tags.html' %}
  75. {% include 'inc/panels/comments.html' %}
  76. {% plugin_left_page object %}
  77. </div>
  78. <div class="col col-md-6">
  79. <div class="card">
  80. <h5 class="card-header">Components</h5>
  81. <div class="card-body">
  82. <table class="table table-hover attr-table">
  83. <tr>
  84. <th scope="row">Interfaces</th>
  85. <td>
  86. {% with component_count=object.interfaces.count %}
  87. {% if component_count %}
  88. <a href="{% url 'dcim:interface_list' %}?module_id={{ object.pk }}">{{ component_count }}</a>
  89. {% else %}
  90. {{ ''|placeholder }}
  91. {% endif %}
  92. {% endwith %}
  93. </td>
  94. </tr>
  95. <tr>
  96. <th scope="row">Console Ports</th>
  97. <td>
  98. {% with component_count=object.consoleports.count %}
  99. {% if component_count %}
  100. <a href="{% url 'dcim:consoleport_list' %}?module_id={{ object.pk }}">{{ component_count }}</a>
  101. {% else %}
  102. {{ ''|placeholder }}
  103. {% endif %}
  104. {% endwith %}
  105. </td>
  106. </tr>
  107. <tr>
  108. <th scope="row">Console Server Ports</th>
  109. <td>
  110. {% with component_count=object.consoleserverports.count %}
  111. {% if component_count %}
  112. <a href="{% url 'dcim:consoleserverport_list' %}?module_id={{ object.pk }}">{{ component_count }}</a>
  113. {% else %}
  114. {{ ''|placeholder }}
  115. {% endif %}
  116. {% endwith %}
  117. </td>
  118. </tr>
  119. <tr>
  120. <th scope="row">Power Ports</th>
  121. <td>
  122. {% with component_count=object.powerports.count %}
  123. {% if component_count %}
  124. <a href="{% url 'dcim:powerport_list' %}?module_id={{ object.pk }}">{{ component_count }}</a>
  125. {% else %}
  126. {{ ''|placeholder }}
  127. {% endif %}
  128. {% endwith %}
  129. </td>
  130. </tr>
  131. <tr>
  132. <th scope="row">Power Outlets</th>
  133. <td>
  134. {% with component_count=object.poweroutlets.count %}
  135. {% if component_count %}
  136. <a href="{% url 'dcim:poweroutlet_list' %}?module_id={{ object.pk }}">{{ component_count }}</a>
  137. {% else %}
  138. {{ ''|placeholder }}
  139. {% endif %}
  140. {% endwith %}
  141. </td>
  142. </tr>
  143. <tr>
  144. <th scope="row">Front Ports</th>
  145. <td>
  146. {% with component_count=object.frontports.count %}
  147. {% if component_count %}
  148. <a href="{% url 'dcim:frontport_list' %}?module_id={{ object.pk }}">{{ component_count }}</a>
  149. {% else %}
  150. {{ ''|placeholder }}
  151. {% endif %}
  152. {% endwith %}
  153. </td>
  154. </tr>
  155. <tr>
  156. <th scope="row">Rear Ports</th>
  157. <td>
  158. {% with component_count=object.rearports.count %}
  159. {% if component_count %}
  160. <a href="{% url 'dcim:rearport_list' %}?module_id={{ object.pk }}">{{ component_count }}</a>
  161. {% else %}
  162. {{ ''|placeholder }}
  163. {% endif %}
  164. {% endwith %}
  165. </td>
  166. </tr>
  167. </table>
  168. </div>
  169. </div>
  170. {% plugin_right_page object %}
  171. </div>
  172. </div>
  173. <div class="row">
  174. <div class="col col-md-12">
  175. {% plugin_full_width_page object %}
  176. </div>
  177. </div>
  178. {% endblock %}