1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +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,10 +136,9 @@
{% 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 %}
@ -187,18 +186,30 @@
{% endif %} {% endif %}
{% endifequal %} {% endifequal %}
{% ifequal status 3 %} {% ifequal status 3 %}
<div role="tabpanel" class="tab-pane tab-pane-bordered active" id="resume">
<form action="" method="post" role="form">{% csrf_token %}
{% if request.user.is_superuser %} {% if request.user.is_superuser %}
<div role="tabpanel" class="tab-pane tab-pane-bordered active" id="resume">
<p>{% trans "This action restore the instance after suspend." %}</p> <p>{% trans "This action restore the instance after suspend." %}</p>
<form action="" method="post" role="form">{% csrf_token %}
<input type="submit" name="resume" class="btn btn-lg btn-success pull-right" value="{% trans "Resume" %}"> <input type="submit" name="resume" class="btn btn-lg btn-success pull-right" value="{% trans "Resume" %}">
{% else %}
<p>{% trans "Administrator blocked your instance." %}</p>
<button class="btn btn-lg btn-success disabled pull-right">{% trans "Resume" %}</button>
{% endif %}
<div class="clearfix"></div> <div class="clearfix"></div>
</form> </form>
</div> </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>
<form action="" method="post" role="form">{% csrf_token %}
<button class="btn btn-lg btn-success disabled pull-right">{% trans "Resume" %}</button>
<div class="clearfix"></div>
</form>
</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">