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

Add forcibly power off option to suspended instance

This commit is contained in:
catborise 2019-01-23 14:30:33 +03:00
parent a3be93874c
commit b757c62d4f

View file

@ -136,12 +136,11 @@
{% trans "Resume" %} {% trans "Resume" %}
</a> </a>
</li> </li>
{% else %} <li role="presentation">
<li role="presentation" class="active"> <a href="#powerforce" aria-controls="powerforce" role="tab" data-toggle="tab">
<a href="#resume" aria-controls="resume" role="tab" data-toggle="tab"> {% trans "Force Off" %}
{% trans "Resume" %} </a>
</a> </li>
</li>
{% endif %} {% endif %}
{% endifequal %} {% endifequal %}
{% ifequal status 5 %} {% ifequal status 5 %}
@ -186,19 +185,31 @@
</div> </div>
{% endif %} {% endif %}
{% endifequal %} {% endifequal %}
{% ifequal status 3 %} {% ifequal status 3 %}
<div role="tabpanel" class="tab-pane tab-pane-bordered active" id="resume"> {% if request.user.is_superuser %}
<form action="" method="post" role="form">{% csrf_token %} <div role="tabpanel" class="tab-pane tab-pane-bordered active" id="resume">
{% if request.user.is_superuser %}
<p>{% trans "This action restore the instance after suspend." %}</p> <p>{% trans "This action restore the instance after suspend." %}</p>
<input type="submit" name="resume" class="btn btn-lg btn-success pull-right" value="{% trans "Resume" %}"> <form action="" method="post" role="form">{% csrf_token %}
{% else %} <input type="submit" name="resume" class="btn btn-lg btn-success pull-right" value="{% trans "Resume" %}">
<div class="clearfix"></div>
</form>
</div>
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="powerforce">
<p>{% trans "This action forcibly powers off the instance and may cause data corruption." %}</p>
<form action="" method="post" role="form">{% csrf_token %}
<input type="submit" name="powerforce" class="btn btn-lg btn-success pull-right" value="{% trans "Force Off" %}">
<div class="clearfix"></div>
</form>
</div>
{% else %}
<div role="tabpanel" class="tab-pane tab-pane-bordered active" id="resume">
<p>{% trans "Administrator blocked your instance." %}</p> <p>{% trans "Administrator blocked your instance." %}</p>
<button class="btn btn-lg btn-success disabled pull-right">{% trans "Resume" %}</button> <form action="" method="post" role="form">{% csrf_token %}
{% endif %} <button class="btn btn-lg btn-success disabled pull-right">{% trans "Resume" %}</button>
<div class="clearfix"></div> <div class="clearfix"></div>
</form> </form>
</div> </div>
{% endif %}
{% endifequal %} {% endifequal %}
{% ifequal status 5 %} {% ifequal status 5 %}
<div role="tabpanel" class="tab-pane tab-pane-bordered active" id="boot"> <div role="tabpanel" class="tab-pane tab-pane-bordered active" id="boot">