1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00

show snapshot list while instance is running. User wanto to see list of running snapshot and delete it.

This commit is contained in:
catborise 2020-01-17 16:14:28 +03:00
parent 59dcdacffc
commit 0c8a0523a8

View file

@ -549,54 +549,51 @@
{% endifequal %} {% endifequal %}
</div> </div>
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="managesnapshot"> <div role="tabpanel" class="tab-pane tab-pane-bordered" id="managesnapshot">
{% ifequal status 5 %} {% if snapshots %}
{% if snapshots %} <p>{% trans "Choose a snapshot for restore/delete" %}</p>
<p>{% trans "Choose a snapshot for restore/delete" %}</p> <div class="table-responsive">
<div class="table-responsive"> <table class="table">
<table class="table"> <thead>
<thead> <th>{% trans "Name" %}</th>
<th>{% trans "Name" %}</th> <th>{% trans "Date" %}</th>
<th>{% trans "Date" %}</th> <th colspan="2">{% trans "Action" %}</th>
<th colspan="2">{% trans "Action" %}</th> </thead>
</thead> <tbody>
<tbody> {% for snap in snapshots %}
{% for snap in snapshots %} <tr>
<tr> <td><strong>{{ snap.name }}</strong></td>
<td><strong>{{ snap.name }}</strong></td> <td>{{ snap.date|date:"M d H:i:s" }}</td>
<td>{{ snap.date|date:"M d H:i:s" }}</td> <td style="width:30px;">
<td style="width:30px;"> <form action="" method="post" style="height:10px" role="form">{% csrf_token %}
<form action="" method="post" style="height:10px" role="form">{% csrf_token %} <input type="hidden" name="name" value="{{ snap.name }}">
<input type="hidden" name="name" value="{{ snap.name }}"> {% ifequal status 5 %}
{% ifequal status 5 %} <button type="submit" class="btn btn-sm btn-default" name="revert_snapshot" title="Revert to this Snapshot" onclick="return confirm('Are you sure?')">
<button type="submit" class="btn btn-sm btn-default" name="revert_snapshot" title="Revert to this Snapshot" onclick="return confirm('Are you sure?')"> <span class="glyphicon glyphicon-save"></span>
<span class="glyphicon glyphicon-save"></span>
</button>
{% else %}
<button type="button" class="btn btn-sm btn-default disabled">
<span class="glyphicon glyphicon-save"></span>
</button>
{% endifequal %}
</form>
</td>
<td style="width:30px;">
<form action="" method="post" role="form">{% csrf_token %}
<input type="hidden" name="name" value="{{ snap.name }}">
<button type="submit" class="btn btn-sm btn-default" name="delete_snapshot" title="Delete Snapshot" onclick="return confirm('{% trans "Are you sure?" %}')">
<span class="glyphicon glyphicon-trash"></span>
</button> </button>
</form> {% else %}
</td> <button type="button" class="btn btn-sm btn-default disabled"
</tr> title="{% trans "To restore snapshots you need Power Off the instance." %}">
{% endfor %} <span class="glyphicon glyphicon-save"></span>
</tbody> </button>
</table> {% endifequal %}
</div> </form>
{% else %} </td>
<p>{% trans "You do not have any snapshots" %}</p> <td style="width:30px;">
{% endif %} <form action="" method="post" role="form">{% csrf_token %}
<input type="hidden" name="name" value="{{ snap.name }}">
<button type="submit" class="btn btn-sm btn-default" name="delete_snapshot" title="Delete Snapshot" onclick="return confirm('{% trans "Are you sure?" %}')">
<span class="glyphicon glyphicon-trash"></span>
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %} {% else %}
<p>{% trans "To restore snapshots you need Power Off the instance." %}</p> <p>{% trans "You do not have any snapshots" %}</p>
{% endifequal %} {% endif %}
</div> </div>
</div> </div>
</div> </div>