Added views to add/remove hosts to/from clusters

This commit is contained in:
Jeremy Stretch
2017-08-21 16:53:36 -04:00
parent e0c0bbba56
commit 6813721997
8 changed files with 275 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
{% load helpers %}
{% block content %}
<div class="row">
<div class="row" xmlns="http://www.w3.org/1999/html">
<div class="col-sm-8 col-md-9">
<ol class="breadcrumb">
<li><a href="{{ cluster.type.get_absolute_url }}">{{ cluster.type }}</a></li>
@@ -89,10 +89,28 @@
<div class="col-md-7">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Devices</strong>
</div>
<div class="panel-body">
<strong>Host Devices</strong>
</div>
{% if perms.virtualization.change_cluster %}
<form action="{% url 'virtualization:cluster_remove_devices' pk=cluster.pk %}" method="post">
{% csrf_token %}
{% endif %}
{% include 'responsive_table.html' with table=device_table %}
{% if perms.virtualization.change_cluster %}
<div class="panel-footer">
<div class="pull-right">
<a href="{% url 'virtualization:cluster_add_devices' pk=cluster.pk %}" class="btn btn-primary btn-xs">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
Add devices
</a>
</div>
<button type="submit" name="_remove" class="btn btn-danger primary btn-xs">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Remove devices
</button>
</div>
</form>
{% endif %}
</div>
</div>
</div>