devicetype.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% block title %}{{ devicetype.manufacturer }} {{ devicetype.model }}{% endblock %}
  4. {% block header %}
  5. <div class="row">
  6. <div class="col-md-12">
  7. <ol class="breadcrumb">
  8. <li><a href="{% url 'dcim:devicetype_list' %}">Device Types</a></li>
  9. <li><a href="{% url 'dcim:devicetype_list' %}?manufacturer={{ devicetype.manufacturer.slug }}">{{ devicetype.manufacturer }}</a></li>
  10. <li>{{ devicetype.model }}</li>
  11. </ol>
  12. </div>
  13. </div>
  14. {% if perms.dcim.change_devicetype or perms.dcim.delete_devicetype %}
  15. <div class="pull-right">
  16. {% if perms.dcim.change_devicetype %}
  17. <a href="{% url 'dcim:devicetype_edit' pk=devicetype.pk %}" class="btn btn-warning">
  18. <span class="fa fa-pencil" aria-hidden="true"></span>
  19. Edit this device type
  20. </a>
  21. {% endif %}
  22. {% if perms.dcim.delete_devicetype %}
  23. <a href="{% url 'dcim:devicetype_delete' pk=devicetype.pk %}" class="btn btn-danger">
  24. <span class="fa fa-trash" aria-hidden="true"></span>
  25. Delete this device type
  26. </a>
  27. {% endif %}
  28. </div>
  29. {% endif %}
  30. <h1>{{ devicetype.manufacturer }} {{ devicetype.model }}</h1>
  31. {% include 'inc/created_updated.html' with obj=devicetype %}
  32. <ul class="nav nav-tabs">
  33. <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
  34. <a href="{{ devicetype.get_absolute_url }}">Device Type</a>
  35. </li>
  36. <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
  37. <a href="{% url 'dcim:devicetype_changelog' pk=devicetype.pk %}">Changelog</a>
  38. </li>
  39. </ul>
  40. {% endblock %}
  41. {% block content %}
  42. <div class="row">
  43. <div class="col-md-5">
  44. <div class="panel panel-default">
  45. <div class="panel-heading">
  46. <strong>Chassis</strong>
  47. </div>
  48. <table class="table table-hover panel-body attr-table">
  49. <tr>
  50. <td>Manufacturer</td>
  51. <td><a href="{% url 'dcim:devicetype_list' %}?manufacturer={{ devicetype.manufacturer.slug }}">{{ devicetype.manufacturer }}</a></td>
  52. </tr>
  53. <tr>
  54. <td>Model Name</td>
  55. <td>
  56. {{ devicetype.model }}<br/>
  57. <small class="text-muted">{{ devicetype.slug }}</small>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td>Part Number</td>
  62. <td>
  63. {% if devicetype.part_number %}
  64. {{ devicetype.part_number }}
  65. {% else %}
  66. <span class="text-muted">N/A</span>
  67. {% endif %}
  68. </td>
  69. </tr>
  70. <tr>
  71. <td>Height (U)</td>
  72. <td>{{ devicetype.u_height }}</td>
  73. </tr>
  74. <tr>
  75. <td>Full Depth</td>
  76. <td>
  77. {% if devicetype.is_full_depth %}
  78. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  79. {% else %}
  80. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  81. {% endif %}
  82. </td>
  83. </tr>
  84. <tr>
  85. <td>Interface Ordering</td>
  86. <td>{{ devicetype.get_interface_ordering_display }}</td>
  87. </tr>
  88. <tr>
  89. <td>Instances</td>
  90. <td><a href="{% url 'dcim:device_list' %}?device_type_id={{ devicetype.pk }}">{{ devicetype.instances.count }}</a></td>
  91. </tr>
  92. </table>
  93. </div>
  94. <div class="panel panel-default">
  95. <div class="panel-heading">
  96. <strong>Function</strong>
  97. </div>
  98. <table class="table table-hover panel-body">
  99. <tr>
  100. <td class="text-right">
  101. {% if devicetype.is_console_server %}
  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>Console Server</strong><br />
  109. <small class="text-muted">This device {% if devicetype.is_console_server %}has{% else %}does not have{% endif %} console server ports</small>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td class="text-right">
  114. {% if devicetype.is_pdu %}
  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>PDU</strong><br />
  122. <small class="text-muted">This device {% if devicetype.is_pdu %}has{% else %}does not have{% endif %} power outlets</small>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td class="text-right">
  127. {% if devicetype.is_network_device %}
  128. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  129. {% else %}
  130. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  131. {% endif %}
  132. </td>
  133. <td>
  134. <strong>Network Device</strong><br />
  135. <small class="text-muted">This device {% if devicetype.is_network_device %}has{% else %}does not have{% endif %} network interfaces</small>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td class="text-right">
  140. {% if devicetype.subdevice_role == True %}
  141. <label class="label label-primary">Parent</label>
  142. {% elif devicetype.subdevice_role == False %}
  143. <label class="label label-info">Child</label>
  144. {% else %}
  145. <label class="label label-default">None</label>
  146. {% endif %}
  147. </td>
  148. <td>
  149. <strong>Parent/Child</strong><br />
  150. {% if devicetype.subdevice_role == True %}
  151. <small class="text-muted">This device has device bays for mounting child devices</small>
  152. {% elif devicetype.subdevice_role == False %}
  153. <small class="text-muted">This device can only be mounted in a parent device</small>
  154. {% else %}
  155. <small class="text-muted">This device does not have device bays</small>
  156. {% endif %}
  157. </td>
  158. </tr>
  159. </table>
  160. </div>
  161. {% include 'inc/custom_fields_panel.html' with obj=devicetype %}
  162. {% include 'extras/inc/tags_panel.html' with tags=devicetype.tags.all url='dcim:devicetype_list' %}
  163. <div class="panel panel-default">
  164. <div class="panel-heading">
  165. <strong>Comments</strong>
  166. </div>
  167. <div class="panel-body rendered-markdown">
  168. {% if devicetype.comments %}
  169. {{ devicetype.comments|gfm }}
  170. {% else %}
  171. <span class="text-muted">None</span>
  172. {% endif %}
  173. </div>
  174. </div>
  175. </div>
  176. <div class="col-md-7">
  177. {% 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' %}
  178. {% 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' %}
  179. {% if devicetype.is_parent_device or devicebay_table.rows %}
  180. {% 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' %}
  181. {% endif %}
  182. {% if devicetype.is_network_device or interface_table.rows %}
  183. {% 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' %}
  184. {% endif %}
  185. {% if devicetype.is_console_server or consoleserverport_table.rows %}
  186. {% 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' %}
  187. {% endif %}
  188. {% if devicetype.is_pdu or poweroutlet_table.rows %}
  189. {% 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' %}
  190. {% endif %}
  191. </div>
  192. </div>
  193. {% endblock %}