From 654dcddf03eba64621d299c4b24b00d147c2c4d3 Mon Sep 17 00:00:00 2001 From: catborise Date: Wed, 18 Jul 2018 15:46:11 +0300 Subject: [PATCH] minor corrections --- instances/templates/instances.html | 564 +++++++++++++++-------------- 1 file changed, 294 insertions(+), 270 deletions(-) diff --git a/instances/templates/instances.html b/instances/templates/instances.html index f41a498..913e990 100644 --- a/instances/templates/instances.html +++ b/instances/templates/instances.html @@ -6,281 +6,305 @@ {% endblock %} {% block content %} - -
-
- {% if request.user.is_superuser %} - {% include 'create_inst_block.html' %} - {% endif %} - {% if all_host_vms or all_user_vms %} - - {% endif %} -

{% trans "Instances" %}

-
-
- - -{% include 'errors_block.html' %} - -
-
-
+ +
+
{% if request.user.is_superuser %} - {% if not all_host_vms %} -
-
- - - {% trans "Warning:" %} {% trans "You don't have any Instace" %} + {% include 'create_inst_block.html' %} + {% endif %} + {% if all_host_vms or all_user_vms %} + -
- {% else %} - - - - - - - - - - - - - - {% for host, inst in all_host_vms.items %} - - - - - - - - - - - - - - - - - - {% 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" %} -
-
- {% 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 %} +

{% trans "Instances" %}

+
+
+ + + {% 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 %} + + + + + + + + + + + {% 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" %} +
+
+ {% 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 %}