devicetype.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% load render_table from django_tables2 %}
  4. {% block title %}{{ devicetype.manufacturer }} {{ devicetype.model }}{% endblock %}
  5. {% block content %}
  6. <div class="row">
  7. <div class="col-md-12">
  8. <ol class="breadcrumb">
  9. <li><a href="{% url 'dcim:devicetype_list' %}">Device Types</a></li>
  10. <li><a href="{% url 'dcim:devicetype_list' %}?manufacturer={{ devicetype.manufacturer.slug }}">{{ devicetype.manufacturer }}</a></li>
  11. <li>{{ devicetype.model }}</li>
  12. </ol>
  13. </div>
  14. </div>
  15. {% if perms.dcim.change_devicetype or perms.dcim.delete_devicetype %}
  16. <div class="pull-right">
  17. {% if perms.dcim.change_devicetype %}
  18. <a href="{% url 'dcim:devicetype_edit' pk=devicetype.pk %}" class="btn btn-warning">
  19. <span class="fa fa-pencil" aria-hidden="true"></span>
  20. Edit this device type
  21. </a>
  22. {% endif %}
  23. {% if perms.dcim.delete_devicetype %}
  24. <a href="{% url 'dcim:devicetype_delete' pk=devicetype.pk %}" class="btn btn-danger">
  25. <span class="fa fa-trash" aria-hidden="true"></span>
  26. Delete this device type
  27. </a>
  28. {% endif %}
  29. </div>
  30. {% endif %}
  31. <h1>{{ devicetype.manufacturer }} {{ devicetype.model }}</h1>
  32. <div class="row">
  33. <div class="col-md-6">
  34. <div class="panel panel-default">
  35. <div class="panel-heading">
  36. <strong>Chassis</strong>
  37. </div>
  38. <table class="table table-hover panel-body attr-table">
  39. <tr>
  40. <td>Manufacturer</td>
  41. <td><a href="{% url 'dcim:devicetype_list' %}?manufacturer={{ devicetype.manufacturer.slug }}">{{ devicetype.manufacturer }}</a></td>
  42. </tr>
  43. <tr>
  44. <td>Model Name</td>
  45. <td>{{ devicetype.model }}</td>
  46. </tr>
  47. <tr>
  48. <td>Part Number</td>
  49. <td>
  50. {% if devicetype.part_number %}
  51. {{ devicetype.part_number }}
  52. {% else %}
  53. <span class="text-muted">N/A</span>
  54. {% endif %}
  55. </td>
  56. </tr>
  57. <tr>
  58. <td>Height (U)</td>
  59. <td>{{ devicetype.u_height }}</td>
  60. </tr>
  61. <tr>
  62. <td>Full Depth</td>
  63. <td>
  64. {% if devicetype.is_full_depth %}
  65. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  66. {% else %}
  67. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  68. {% endif %}
  69. </td>
  70. </tr>
  71. <tr>
  72. <td>Interface Ordering</td>
  73. <td>{{ devicetype.get_interface_ordering_display }}</td>
  74. </tr>
  75. <tr>
  76. <td>Instances</td>
  77. <td><a href="{% url 'dcim:device_list' %}?device_type_id={{ devicetype.pk }}">{{ devicetype.instances.count }}</a></td>
  78. </tr>
  79. </table>
  80. </div>
  81. <div class="panel panel-default">
  82. <div class="panel-heading">
  83. <strong>Function</strong>
  84. </div>
  85. <table class="table table-hover panel-body">
  86. <tr>
  87. <td class="text-right">
  88. {% if devicetype.is_console_server %}
  89. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  90. {% else %}
  91. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  92. {% endif %}
  93. </td>
  94. <td>
  95. <strong>Console Server</strong><br />
  96. <small class="text-muted">This device {% if devicetype.is_console_server %}has{% else %}does not have{% endif %} console server ports</small>
  97. </td>
  98. </tr>
  99. <tr>
  100. <td class="text-right">
  101. {% if devicetype.is_pdu %}
  102. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  103. {% else %}
  104. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  105. {% endif %}
  106. </td>
  107. <td>
  108. <strong>PDU</strong><br />
  109. <small class="text-muted">This device {% if devicetype.is_pdu %}has{% else %}does not have{% endif %} power outlets</small>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td class="text-right">
  114. {% if devicetype.is_network_device %}
  115. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  116. {% else %}
  117. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  118. {% endif %}
  119. </td>
  120. <td>
  121. <strong>Network Device</strong><br />
  122. <small class="text-muted">This device {% if devicetype.is_network_device %}has{% else %}does not have{% endif %} non-management network interfaces</small>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td class="text-right">
  127. {% if devicetype.subdevice_role == True %}
  128. <label class="label label-primary">Parent</label>
  129. {% elif devicetype.subdevice_role == False %}
  130. <label class="label label-info">Child</label>
  131. {% else %}
  132. <label class="label label-default">None</label>
  133. {% endif %}
  134. </td>
  135. <td>
  136. <strong>Parent/Child</strong><br />
  137. {% if devicetype.subdevice_role == True %}
  138. <small class="text-muted">This device has device bays for mounting child devices</small>
  139. {% elif devicetype.subdevice_role == False %}
  140. <small class="text-muted">This device can only be mounted in a parent device</small>
  141. {% else %}
  142. <small class="text-muted">This device does not have device bays</small>
  143. {% endif %}
  144. </td>
  145. </tr>
  146. </table>
  147. </div>
  148. {% with devicetype.get_custom_fields as custom_fields %}
  149. {% include 'inc/custom_fields_panel.html' %}
  150. {% endwith %}
  151. <div class="panel panel-default">
  152. <div class="panel-heading">
  153. <strong>Comments</strong>
  154. </div>
  155. <div class="panel-body">
  156. {% if devicetype.comments %}
  157. {{ devicetype.comments|gfm }}
  158. {% else %}
  159. <span class="text-muted">None</span>
  160. {% endif %}
  161. </div>
  162. </div>
  163. {% include 'dcim/inc/devicetype_component_table.html' with table=consoleport_table title='Console Ports' add_url='dcim:devicetype_add_consoleport' delete_url='dcim:devicetype_delete_consoleport' %}
  164. {% include 'dcim/inc/devicetype_component_table.html' with table=powerport_table title='Power Ports' add_url='dcim:devicetype_add_powerport' delete_url='dcim:devicetype_delete_powerport' %}
  165. {% include 'dcim/inc/devicetype_component_table.html' with table=mgmt_interface_table title='Management Interfaces' add_url='dcim:devicetype_add_interface' add_url_extra='?mgmt_only=1' edit_url='dcim:devicetype_bulkedit_interface' delete_url='dcim:devicetype_delete_interface' %}
  166. </div>
  167. <div class="col-md-6">
  168. {% if devicetype.is_parent_device %}
  169. {% include 'dcim/inc/devicetype_component_table.html' with table=devicebay_table title='Device Bays' add_url='dcim:devicetype_add_devicebay' delete_url='dcim:devicetype_delete_devicebay' %}
  170. {% endif %}
  171. {% if devicetype.is_network_device %}
  172. {% include 'dcim/inc/devicetype_component_table.html' with table=interface_table title='Interfaces' add_url='dcim:devicetype_add_interface' edit_url='dcim:devicetype_bulkedit_interface' delete_url='dcim:devicetype_delete_interface' %}
  173. {% endif %}
  174. {% if devicetype.is_console_server %}
  175. {% include 'dcim/inc/devicetype_component_table.html' with table=consoleserverport_table title='Console Server Ports' add_url='dcim:devicetype_add_consoleserverport' delete_url='dcim:devicetype_delete_consoleserverport' %}
  176. {% endif %}
  177. {% if devicetype.is_pdu %}
  178. {% include 'dcim/inc/devicetype_component_table.html' with table=poweroutlet_table title='Power Outlets' add_url='dcim:devicetype_add_poweroutlet' delete_url='dcim:devicetype_delete_poweroutlet' %}
  179. {% endif %}
  180. </div>
  181. </div>
  182. {% endblock %}