devicetype.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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>Height (U)</td>
  49. <td>{{ devicetype.u_height }}</td>
  50. </tr>
  51. <tr>
  52. <td>Full Depth</td>
  53. <td>
  54. {% if devicetype.is_full_depth %}
  55. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  56. {% else %}
  57. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  58. {% endif %}
  59. </td>
  60. </tr>
  61. </table>
  62. </div>
  63. <div class="panel panel-default">
  64. <div class="panel-heading">
  65. <strong>Function</strong>
  66. </div>
  67. <table class="table table-hover panel-body">
  68. <tr>
  69. <td class="text-right">
  70. {% if devicetype.is_console_server %}
  71. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  72. {% else %}
  73. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  74. {% endif %}
  75. </td>
  76. <td>
  77. <strong>Console Server</strong><br />
  78. <small class="text-muted">This device {% if devicetype.is_console_server %}has{% else %}does not have{% endif %} console server ports</small>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td class="text-right">
  83. {% if devicetype.is_pdu %}
  84. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  85. {% else %}
  86. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  87. {% endif %}
  88. </td>
  89. <td>
  90. <strong>PDU</strong><br />
  91. <small class="text-muted">This device {% if devicetype.is_pdu %}has{% else %}does not have{% endif %} power outlets</small>
  92. </td>
  93. </tr>
  94. <tr>
  95. <td class="text-right">
  96. {% if devicetype.is_network_device %}
  97. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  98. {% else %}
  99. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  100. {% endif %}
  101. </td>
  102. <td>
  103. <strong>Network Device</strong><br />
  104. <small class="text-muted">This device {% if devicetype.is_network_device %}has{% else %}does not have{% endif %} non-management network interfaces</small>
  105. </td>
  106. </tr>
  107. <tr>
  108. <td class="text-right">
  109. {% if devicetype.subdevice_role == True %}
  110. <label class="label label-primary">Parent</label>
  111. {% elif devicetype.subdevice_role == False %}
  112. <label class="label label-info">Child</label>
  113. {% else %}
  114. <label class="label label-default">None</label>
  115. {% endif %}
  116. </td>
  117. <td>
  118. <strong>Parent/Child</strong><br />
  119. {% if devicetype.subdevice_role == True %}
  120. <small class="text-muted">This device has device bays for mounting child devices</small>
  121. {% elif devicetype.subdevice_role == False %}
  122. <small class="text-muted">This device can only be mounted in a parent device</small>
  123. {% else %}
  124. <small class="text-muted">This device does not have device bays</small>
  125. {% endif %}
  126. </td>
  127. </tr>
  128. </table>
  129. </div>
  130. {% 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' %}
  131. {% 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' %}
  132. {% 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' %}
  133. </div>
  134. <div class="col-md-6">
  135. {% if devicetype.is_parent_device %}
  136. {% 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' %}
  137. {% endif %}
  138. {% if devicetype.is_network_device %}
  139. {% 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' %}
  140. {% endif %}
  141. {% if devicetype.is_console_server %}
  142. {% 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' %}
  143. {% endif %}
  144. {% if devicetype.is_pdu %}
  145. {% 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' %}
  146. {% endif %}
  147. </div>
  148. </div>
  149. {% endblock %}