From 65769eb89437fed4349ef94e9e3a4334d8c8bdee Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 19 Jul 2018 09:39:41 +0300 Subject: [PATCH] intances reformat code. Fix typo error --- instances/templates/instances.html | 606 +++++++++++++---------------- 1 file changed, 275 insertions(+), 331 deletions(-) diff --git a/instances/templates/instances.html b/instances/templates/instances.html index 913e990..c59abf4 100644 --- a/instances/templates/instances.html +++ b/instances/templates/instances.html @@ -3,348 +3,292 @@ {% load staticfiles %} {% block title %}{% trans "Instances" %}{% endblock %} {% block style %} - + {% endblock %} {% block content %} - -
-
- {% if request.user.is_superuser %} - {% include 'create_inst_block.html' %} - {% endif %} - {% if all_host_vms or all_user_vms %} - -
- + - {% include 'errors_block.html' %} + {% include 'errors_block.html' %} -
-
-
- {% if request.user.is_superuser %} - {% if not all_host_vms %} -
-
- - - {% trans "Warning:" %} {% trans "You don't have any Instace" %} -
-
- {% else %} - - - - - - - - - - - - - - {% for host, inst in all_host_vms.items %} - - - - - - - - - + + {% else %} +
#Name
Description
UserStatusVCPUMemoryActions & Mem Usage
{{ forloop.counter }}{{ host.1 }}{% ifequal host.2 1 %}{% trans "Active" %} - {% endifequal %} - {% ifequal host.2 2 %}{% trans "Not Active" %} - {% endifequal %} - {% ifequal host.2 3 %} - {% trans "Connection Failed" %} - {% endifequal %} - {{ host.3 }}{{ host.4|filesizeformat }} -
{{ host.5 }}% +
+
+
+ {% if request.user.is_superuser %} + {% if not all_host_vms %} +
+
+ + {% trans "Warning:" %} {% trans "You don't have any Instance" %}
-
+ + + + + + + + + + + + + {% for host, inst in all_host_vms.items %} + + + + + + + + + - {% for vm, info in inst.items %} - - - - - - - - - - {% endfor %} - {% endfor %} - -
#Name
Description
UserStatusVCPUMemoryActions & Mem Usage
{{ forloop.counter }}{{ host.1 }}{% ifequal host.2 1 %}{% trans "Active" %} + {% endifequal %} + {% ifequal host.2 2 %}{% trans "Not Active" %} + {% endifequal %} + {% ifequal host.2 3 %}{% trans "Connection Failed" %} + {% endifequal %} + {{ host.3 }}{{ host.4|filesizeformat }} +
{{ host.5 }}%
+
{{ forloop.counter }}   {{ vm }}
- {{ info.title }} -
- {% if info.userinstances.count > 0 %} - {{ info.userinstances.first_user.user.username }} - {% if info.userinstances.count > 1 %} (+ - {{ info.userinstances.count|add:"-1" }}){% endif %}{% endif %} - - {% ifequal info.status 1 %} - {% trans "Active" %} - {% endifequal %} - {% ifequal info.status 5 %} - {% trans "Off" %} - {% endifequal %} - {% ifequal info.status 3 %} - {% trans "Suspend" %} - {% endifequal %} - {{ info.vcpu }}{{ info.memory |filesizeformat }} -
{% csrf_token %} - - - {% ifequal info.status 5 %} - {% if info.is_template %} - - {% else %} - - {% endif %} - - - - - {% endifequal %} - {% ifequal info.status 3 %} - - - - - - {% endifequal %} - {% ifequal info.status 1 %} - - - - - - - - {% endifequal %} -
-
- {% endif %} - {% else %} - {% if not all_user_vms %} -
-
- - - {% trans "Warning:" %} {% trans "You don't have any Instance" %} -
+ {% for vm, info in inst.items %} + + + {{ forloop.counter }}   {{ vm }}
{{ info.title }} + {% if info.userinstances.count > 0 %}{{ info.userinstances.first_user.user.username }}{% if info.userinstances.count > 1 %} (+{{ info.userinstances.count|add:"-1" }}){% endif %}{% endif %} + {% ifequal info.status 1 %} + {% trans "Active" %} + {% endifequal %} + {% ifequal info.status 5 %} + {% trans "Off" %} + {% endifequal %} + {% ifequal info.status 3 %} + {% trans "Suspend" %} + {% endifequal %} + + {{ info.vcpu }} + {{ info.memory |filesizeformat }} +
{% csrf_token %} + + + {% ifequal info.status 5 %} + {% if info.is_template %} + + {% else %} + + {% endif %} + + + + + {% endifequal %} + {% ifequal info.status 3 %} + + + + + + {% endifequal %} + {% ifequal info.status 1 %} + + + + + + + + {% endifequal %} +
+ + + {% endfor %} + {% endfor %} + + + {% endif %} + {% else %} + {% if not all_user_vms %} +
+
+ + {% trans "Warning:" %} {% trans "You don't have any Instance" %} +
+
+ {% else %} + + + + + + + + + + + + {% for inst, vm in all_user_vms.items %} + + + + + + + + {% endfor %} + +
NameStatusVCPUMemoryActions
{{ vm.name }}
{{ vm.title }}
{% ifequal vm.status 1 %} + {% trans "Active" %} + {% endifequal %} + {% ifequal vm.status 5 %} + {% trans "Off" %} + {% endifequal %} + {% ifequal vm.status 3 %} + {% trans "Suspend" %} + {% endifequal %} + {{ vm.vcpu }}{{ vm.memory }} {% trans "MB" %}
{% csrf_token %} + + + {% ifequal vm.status 5 %} + {% if inst.instance.is_template %} + + {% else %} + + {% endif %} + + + + {% endifequal %} + {% ifequal vm.status 3 %} + + + + + {% endifequal %} + {% ifequal vm.status 1 %} + + + + + + + {% endifequal %} +
+
+ {% endif %} + {% endif %}
- {% else %} - - - - - - - - - - - - {% for inst, vm in all_user_vms.items %} - - - - - - - - {% endfor %} - -
NameStatusVCPUMemoryActions
{{ vm.name }}
- {{ vm.title }} -
{% ifequal vm.status 1 %} - {% trans "Active" %} - {% endifequal %} - {% ifequal vm.status 5 %} - {% trans "Off" %} - {% endifequal %} - {% ifequal vm.status 3 %} - {% trans "Suspend" %} - {% endifequal %} - {{ vm.vcpu }}{{ vm.memory }} {% trans "MB" %} -
{% csrf_token %} - - - {% ifequal vm.status 5 %} - {% if inst.instance.is_template %} - - {% else %} - - {% endif %} - - - - {% endifequal %} - {% ifequal vm.status 3 %} - - - - - {% endifequal %} - {% ifequal vm.status 1 %} - - - - - - - {% endifequal %} -
-
- {% endif %} - {% endif %} -
-
-
+
+ {% endblock %} {% block script %} - + + + + +{% if request.user.is_superuser %} - - - {% if request.user.is_superuser %} - - {% endif %} +{% endif %} {% endblock %}