devicetype.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% load render_table from django_tables2 %}
  4. {% block title %}{{ devicetype }}{% 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="glyphicon glyphicon-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="glyphicon glyphicon-trash" aria-hidden="true"></span>
  26. Delete this device type
  27. </a>
  28. {% endif %}
  29. </div>
  30. {% endif %}
  31. <h1>{{ devicetype }}</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">
  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. </table>
  72. </div>
  73. <div class="panel panel-default">
  74. <div class="panel-heading">
  75. <strong>Function</strong>
  76. </div>
  77. <table class="table table-hover panel-body">
  78. <tr>
  79. <td class="text-right">
  80. {% if devicetype.is_console_server %}
  81. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  82. {% else %}
  83. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  84. {% endif %}
  85. </td>
  86. <td>
  87. <strong>Console Server</strong><br />
  88. <small class="text-muted">This device {% if devicetype.is_console_server %}has{% else %}does not have{% endif %} console server ports</small>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="text-right">
  93. {% if devicetype.is_pdu %}
  94. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  95. {% else %}
  96. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  97. {% endif %}
  98. </td>
  99. <td>
  100. <strong>PDU</strong><br />
  101. <small class="text-muted">This device {% if devicetype.is_pdu %}has{% else %}does not have{% endif %} power outlets</small>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td class="text-right">
  106. {% if devicetype.is_network_device %}
  107. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  108. {% else %}
  109. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  110. {% endif %}
  111. </td>
  112. <td>
  113. <strong>Network Device</strong><br />
  114. <small class="text-muted">This device {% if devicetype.is_network_device %}has{% else %}does not have{% endif %} non-management network interfaces</small>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="text-right">
  119. {% if devicetype.subdevice_role == True %}
  120. <label class="label label-primary">Parent</label>
  121. {% elif devicetype.subdevice_role == False %}
  122. <label class="label label-info">Child</label>
  123. {% else %}
  124. <label class="label label-default">None</label>
  125. {% endif %}
  126. </td>
  127. <td>
  128. <strong>Parent/Child</strong><br />
  129. {% if devicetype.subdevice_role == True %}
  130. <small class="text-muted">This device has device bays for mounting child devices</small>
  131. {% elif devicetype.subdevice_role == False %}
  132. <small class="text-muted">This device can only be mounted in a parent device</small>
  133. {% else %}
  134. <small class="text-muted">This device does not have device bays</small>
  135. {% endif %}
  136. </td>
  137. </tr>
  138. </table>
  139. </div>
  140. {% 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' %}
  141. {% 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' %}
  142. {% 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' delete_url='dcim:devicetype_delete_interface' %}
  143. </div>
  144. <div class="col-md-6">
  145. {% if devicetype.is_parent_device %}
  146. {% 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' %}
  147. {% endif %}
  148. {% if devicetype.is_network_device %}
  149. {% include 'dcim/inc/devicetype_component_table.html' with table=interface_table title='Interfaces' add_url='dcim:devicetype_add_interface' delete_url='dcim:devicetype_delete_interface' %}
  150. {% endif %}
  151. {% if devicetype.is_console_server %}
  152. {% 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' %}
  153. {% endif %}
  154. {% if devicetype.is_pdu %}
  155. {% 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' %}
  156. {% endif %}
  157. </div>
  158. </div>
  159. {% endblock %}