From b757c62d4f06e20f560e51b4f560872e5dbce257 Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 23 Jan 2019 14:30:33 +0300 Subject: [PATCH] Add forcibly power off option to suspended instance --- instances/templates/instance.html | 45 +++++++++++++++++++------------ 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/instances/templates/instance.html b/instances/templates/instance.html index bd6bb78..4631120 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -136,12 +136,11 @@ {% trans "Resume" %} - {% else %} - +
  • + + {% trans "Force Off" %} + +
  • {% endif %} {% endifequal %} {% ifequal status 5 %} @@ -186,19 +185,31 @@ {% endif %} {% endifequal %} - {% ifequal status 3 %} -
    -
    {% csrf_token %} - {% if request.user.is_superuser %} + {% ifequal status 3 %} + {% if request.user.is_superuser %} +

    {% trans "This action restore the instance after suspend." %}

    - - {% else %} + {% csrf_token %} + +
    + +
    +
    +

    {% trans "This action forcibly powers off the instance and may cause data corruption." %}

    +
    {% csrf_token %} + +
    +
    +
    + {% else %} +

    {% trans "Administrator blocked your instance." %}

    - - {% endif %} -
    - -
    +
    {% csrf_token %} + +
    +
    +
    + {% endif %} {% endifequal %} {% ifequal status 5 %}