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,10 +136,9 @@
{% trans "Resume" %}
</a>
</li>
{% else %}
<li role="presentation" class="active">
<a href="#resume" aria-controls="resume" role="tab" data-toggle="tab">
{% trans "Resume" %}
<li role="presentation">
<a href="#powerforce" aria-controls="powerforce" role="tab" data-toggle="tab">
{% trans "Force Off" %}
</a>
</li>
{% endif %}
@ -187,18 +186,30 @@
{% endif %}
{% endifequal %}
{% 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 %}
<div role="tabpanel" class="tab-pane tab-pane-bordered active" id="resume">
<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" %}">
{% 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>
</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>
<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 %}
{% ifequal status 5 %}
<div role="tabpanel" class="tab-pane tab-pane-bordered active" id="boot">