devicetype.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. {% extends '_base.html' %}
  2. {% load helpers %}
  3. {% block title %}{{ devicetype.manufacturer }} {{ devicetype.model }}{% endblock %}
  4. {% block header %}
  5. <div class="row noprint">
  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 noprint">
  16. {% if perms.dcim.change_devicetype %}
  17. <div class="btn-group">
  18. <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  19. <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add Components <span class="caret"></span>
  20. </button>
  21. <ul class="dropdown-menu">
  22. {% if perms.dcim.add_consoleporttemplate %}<li><a href="{% url 'dcim:devicetype_add_consoleport' pk=devicetype.pk %}">Console Ports</a></li>{% endif %}
  23. {% if perms.dcim.add_consoleserverporttemplate %}<li><a href="{% url 'dcim:devicetype_add_consoleserverport' pk=devicetype.pk %}">Console Server Ports</a></li>{% endif %}
  24. {% if perms.dcim.add_powerporttemplate %}<li><a href="{% url 'dcim:devicetype_add_powerport' pk=devicetype.pk %}">Power Ports</a></li>{% endif %}
  25. {% if perms.dcim.add_poweroutlettemplate %}<li><a href="{% url 'dcim:devicetype_add_poweroutlet' pk=devicetype.pk %}">Power Outlets</a></li>{% endif %}
  26. {% if perms.dcim.add_interfacetemplate %}<li><a href="{% url 'dcim:devicetype_add_interface' pk=devicetype.pk %}">Interfaces</a></li>{% endif %}
  27. {% if perms.dcim.add_frontporttemplate %}<li><a href="{% url 'dcim:devicetype_add_frontport' pk=devicetype.pk %}">Front Ports</a></li>{% endif %}
  28. {% if perms.dcim.add_rearporttemplate %}<li><a href="{% url 'dcim:devicetype_add_rearport' pk=devicetype.pk %}">Rear Ports</a></li>{% endif %}
  29. {% if perms.dcim.add_devicebaytemplate %}<li><a href="{% url 'dcim:devicetype_add_devicebay' pk=devicetype.pk %}">Device Bays</a></li>{% endif %}
  30. </ul>
  31. </div>
  32. <a href="{% url 'dcim:devicetype_edit' pk=devicetype.pk %}" class="btn btn-warning">
  33. <span class="fa fa-pencil" aria-hidden="true"></span>
  34. Edit this device type
  35. </a>
  36. {% endif %}
  37. {% if perms.dcim.delete_devicetype %}
  38. <a href="{% url 'dcim:devicetype_delete' pk=devicetype.pk %}" class="btn btn-danger">
  39. <span class="fa fa-trash" aria-hidden="true"></span>
  40. Delete this device type
  41. </a>
  42. {% endif %}
  43. </div>
  44. {% endif %}
  45. <h1>{{ devicetype.manufacturer }} {{ devicetype.model }}</h1>
  46. {% include 'inc/created_updated.html' with obj=devicetype %}
  47. <ul class="nav nav-tabs">
  48. <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
  49. <a href="{{ devicetype.get_absolute_url }}">Device Type</a>
  50. </li>
  51. <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
  52. <a href="{% url 'dcim:devicetype_changelog' pk=devicetype.pk %}">Changelog</a>
  53. </li>
  54. </ul>
  55. {% endblock %}
  56. {% block content %}
  57. <div class="row">
  58. <div class="col-md-6">
  59. <div class="panel panel-default">
  60. <div class="panel-heading">
  61. <strong>Chassis</strong>
  62. </div>
  63. <table class="table table-hover panel-body attr-table">
  64. <tr>
  65. <td>Manufacturer</td>
  66. <td><a href="{% url 'dcim:devicetype_list' %}?manufacturer={{ devicetype.manufacturer.slug }}">{{ devicetype.manufacturer }}</a></td>
  67. </tr>
  68. <tr>
  69. <td>Model Name</td>
  70. <td>
  71. {{ devicetype.model }}<br/>
  72. <small class="text-muted">{{ devicetype.slug }}</small>
  73. </td>
  74. </tr>
  75. <tr>
  76. <td>Part Number</td>
  77. <td>{{ devicetype.part_number|placeholder }}</td>
  78. </tr>
  79. <tr>
  80. <td>Height (U)</td>
  81. <td>{{ devicetype.u_height }}</td>
  82. </tr>
  83. <tr>
  84. <td>Full Depth</td>
  85. <td>
  86. {% if devicetype.is_full_depth %}
  87. <i class="glyphicon glyphicon-ok text-success" title="Yes"></i>
  88. {% else %}
  89. <i class="glyphicon glyphicon-remove text-danger" title="No"></i>
  90. {% endif %}
  91. </td>
  92. </tr>
  93. <tr>
  94. <td>Parent/Child</td>
  95. <td>
  96. {% if devicetype.subdevice_role == True %}
  97. <label class="label label-primary">Parent</label>
  98. {% elif devicetype.subdevice_role == False %}
  99. <label class="label label-info">Child</label>
  100. {% else %}
  101. <span class="text-muted">&mdash;</span>
  102. {% endif %}
  103. </td>
  104. </tr>
  105. <tr>
  106. <td>Instances</td>
  107. <td><a href="{% url 'dcim:device_list' %}?device_type_id={{ devicetype.pk }}">{{ devicetype.instances.count }}</a></td>
  108. </tr>
  109. </table>
  110. </div>
  111. </div>
  112. <div class="col-md-6">
  113. {% include 'inc/custom_fields_panel.html' with obj=devicetype %}
  114. {% include 'extras/inc/tags_panel.html' with tags=devicetype.tags.all url='dcim:devicetype_list' %}
  115. <div class="panel panel-default">
  116. <div class="panel-heading">
  117. <strong>Comments</strong>
  118. </div>
  119. <div class="panel-body rendered-markdown">
  120. {% if devicetype.comments %}
  121. {{ devicetype.comments|gfm }}
  122. {% else %}
  123. <span class="text-muted">None</span>
  124. {% endif %}
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. {% if devicetype.consoleport_templates.exists or devicetype.powerport_templates.exists %}
  130. <div class="row">
  131. <div class="col-md-6">
  132. {% 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' %}
  133. </div>
  134. <div class="col-md-6">
  135. {% 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' %}
  136. </div>
  137. </div>
  138. {% endif %}
  139. {% if devicetype.is_parent_device or devicebay_table.rows %}
  140. <div class="row">
  141. <div class="col-md-12">
  142. {% 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' %}
  143. </div>
  144. </div>
  145. {% endif %}
  146. {% if devicetype.consoleserverport_templates.exists %}
  147. <div class="row">
  148. <div class="col-md-12">
  149. {% 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' %}
  150. </div>
  151. </div>
  152. {% endif %}
  153. {% if devicetype.poweroutlet_templates.exists %}
  154. <div class="row">
  155. <div class="col-md-12">
  156. {% 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' %}
  157. </div>
  158. </div>
  159. {% endif %}
  160. {% if devicetype.interface_templates.exists %}
  161. <div class="row">
  162. <div class="col-md-12">
  163. {% 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' %}
  164. </div>
  165. </div>
  166. {% endif %}
  167. {% if devicetype.frontport_templates.exists or devicetype.rearport_templates.exists %}
  168. <div class="row">
  169. <div class="col-md-6">
  170. {% include 'dcim/inc/devicetype_component_table.html' with table=front_port_table title='Front Ports' add_url='dcim:devicetype_add_frontport' delete_url='dcim:devicetype_delete_frontport' %}
  171. </div>
  172. <div class="col-md-6">
  173. {% include 'dcim/inc/devicetype_component_table.html' with table=rear_port_table title='Rear Ports' add_url='dcim:devicetype_add_rearport' delete_url='dcim:devicetype_delete_rearport' %}
  174. </div>
  175. </div>
  176. {% endif %}
  177. {% endblock %}