cluster.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. {% extends 'base.html' %}
  2. {% load buttons %}
  3. {% load custom_links %}
  4. {% load helpers %}
  5. {% load plugins %}
  6. {% block header %}
  7. <div class="row noprint" xmlns="http://www.w3.org/1999/html">
  8. <div class="col-sm-8 col-md-9">
  9. <ol class="breadcrumb">
  10. <li><a href="{{ cluster.type.get_absolute_url }}">{{ cluster.type }}</a></li>
  11. {% if cluster.group %}
  12. <li><a href="{{ cluster.group.get_absolute_url }}">{{ cluster.group }}</a></li>
  13. {% endif %}
  14. <li>{{ cluster }}</li>
  15. </ol>
  16. </div>
  17. <div class="col-sm-4 col-md-3">
  18. <form action="{% url 'virtualization:cluster_list' %}" method="get">
  19. <div class="input-group">
  20. <input type="text" name="q" class="form-control" placeholder="Search clusters" />
  21. <span class="input-group-btn">
  22. <button type="submit" class="btn btn-primary">
  23. <span class="fa fa-search" aria-hidden="true"></span>
  24. </button>
  25. </span>
  26. </div>
  27. </form>
  28. </div>
  29. </div>
  30. <div class="pull-right noprint">
  31. {% plugin_buttons cluster %}
  32. {% if perms.virtualization.add_cluster %}
  33. {% clone_button cluster %}
  34. {% endif %}
  35. {% if perms.virtualization.change_cluster %}
  36. {% edit_button cluster %}
  37. {% endif %}
  38. {% if perms.virtualization.delete_cluster %}
  39. {% delete_button cluster %}
  40. {% endif %}
  41. </div>
  42. <h1>{% block title %}{{ cluster }}{% endblock %}</h1>
  43. {% include 'inc/created_updated.html' with obj=cluster %}
  44. <div class="pull-right noprint">
  45. {% custom_links cluster %}
  46. </div>
  47. <ul class="nav nav-tabs">
  48. <li role="presentation"{% if not active_tab %} class="active"{% endif %}>
  49. <a href="{{ cluster.get_absolute_url }}">Cluster</a>
  50. </li>
  51. {% if perms.extras.view_objectchange %}
  52. <li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
  53. <a href="{% url 'virtualization:cluster_changelog' pk=cluster.pk %}">Change Log</a>
  54. </li>
  55. {% endif %}
  56. </ul>
  57. {% endblock %}
  58. {% block content %}
  59. <div class="row">
  60. <div class="col-md-5">
  61. <div class="panel panel-default">
  62. <div class="panel-heading">
  63. <strong>Cluster</strong>
  64. </div>
  65. <table class="table table-hover panel-body attr-table">
  66. <tr>
  67. <td>Name</td>
  68. <td>{{ cluster.name }}</td>
  69. </tr>
  70. <tr>
  71. <td>Type</td>
  72. <td><a href="{{ cluster.type.get_absolute_url }}">{{ cluster.type }}</a></td>
  73. </tr>
  74. <tr>
  75. <td>Group</td>
  76. <td>
  77. {% if cluster.group %}
  78. <a href="{{ cluster.group.get_absolute_url }}">{{ cluster.group }}</a>
  79. {% else %}
  80. <span class="text-muted">None</span>
  81. {% endif %}
  82. </td>
  83. </tr>
  84. <tr>
  85. <td>Tenant</td>
  86. <td>
  87. {% if cluster.tenant %}
  88. <a href="{{ cluster.tenant.get_absolute_url }}">{{ cluster.tenant }}</a>
  89. {% else %}
  90. <span class="text-muted">None</span>
  91. {% endif %}
  92. </td>
  93. </tr>
  94. <tr>
  95. <td>Site</td>
  96. <td>
  97. {% if cluster.site %}
  98. <a href="{{ cluster.site.get_absolute_url }}">{{ cluster.site }}</a>
  99. {% else %}
  100. <span class="text-muted">None</span>
  101. {% endif %}
  102. </td>
  103. </tr>
  104. <tr>
  105. <td>Virtual Machines</td>
  106. <td><a href="{% url 'virtualization:virtualmachine_list' %}?cluster_id={{ cluster.pk }}">{{ cluster.virtual_machines.count }}</a></td>
  107. </tr>
  108. </table>
  109. </div>
  110. {% include 'inc/custom_fields_panel.html' with obj=cluster %}
  111. {% include 'extras/inc/tags_panel.html' with tags=cluster.tags.all url='virtualization:cluster_list' %}
  112. <div class="panel panel-default">
  113. <div class="panel-heading">
  114. <strong>Comments</strong>
  115. </div>
  116. <div class="panel-body rendered-markdown">
  117. {% if cluster.comments %}
  118. {{ cluster.comments|render_markdown }}
  119. {% else %}
  120. <span class="text-muted">None</span>
  121. {% endif %}
  122. </div>
  123. </div>
  124. {% plugin_left_page cluster %}
  125. </div>
  126. <div class="col-md-7">
  127. <div class="panel panel-default">
  128. <div class="panel-heading">
  129. <strong>Host Devices</strong>
  130. </div>
  131. {% if perms.virtualization.change_cluster %}
  132. <form action="{% url 'virtualization:cluster_remove_devices' pk=cluster.pk %}" method="post">
  133. {% csrf_token %}
  134. {% endif %}
  135. {% include 'responsive_table.html' with table=device_table %}
  136. {% if perms.virtualization.change_cluster %}
  137. <div class="panel-footer noprint">
  138. <div class="pull-right">
  139. <a href="{% url 'virtualization:cluster_add_devices' pk=cluster.pk %}?site={{ cluster.site.pk }}" class="btn btn-primary btn-xs">
  140. <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
  141. Add devices
  142. </a>
  143. </div>
  144. <button type="submit" name="_remove" class="btn btn-danger primary btn-xs">
  145. <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
  146. Remove devices
  147. </button>
  148. </div>
  149. </form>
  150. {% endif %}
  151. </div>
  152. {% plugin_right_page cluster %}
  153. </div>
  154. </div>
  155. <div class="row">
  156. <div class="col-md-12">
  157. {% plugin_full_width_page cluster %}
  158. </div>
  159. </div>
  160. {% endblock %}