From c763eaa63cc3563fea43a7e5ccddfcceb79a8d67 Mon Sep 17 00:00:00 2001 From: Retspen Date: Thu, 5 Mar 2015 16:56:22 +0200 Subject: [PATCH] Add responsive to starages --- static/css/webvirtcloud.css | 2 +- templates/base.html | 6 +- templates/computes.html | 97 +++++++------- templates/create_stg_vol_block.html | 91 +++++++++++++ templates/instances.html | 1 + templates/sidebar.html | 2 +- templates/storage.html | 201 ++++++++++++++++++++++++++++ templates/storages.html | 2 - 8 files changed, 344 insertions(+), 58 deletions(-) create mode 100644 templates/create_stg_vol_block.html create mode 100644 templates/storage.html diff --git a/static/css/webvirtcloud.css b/static/css/webvirtcloud.css index 2c90ad5..469a5fe 100644 --- a/static/css/webvirtcloud.css +++ b/static/css/webvirtcloud.css @@ -61,5 +61,5 @@ body { } .page-header { - margin: 0 0 20px; + margin: 5px 5px 20px 20px; } \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 16633c8..cae2bb8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -63,11 +63,7 @@ - - - - - + {% block script %}{% endblock %} \ No newline at end of file diff --git a/templates/computes.html b/templates/computes.html index 2601238..d97bb9c 100644 --- a/templates/computes.html +++ b/templates/computes.html @@ -16,60 +16,44 @@
{% if computes_info %} {% for compute in computes_info %} -
-
+
+
{% ifequal compute.status 1 %}

{{ compute.name }} - +

{% else %}

{{ compute.name }} - +

{% endifequal %}
-

-

{% csrf_token %} - - -
-

-

- {% ifequal compute.type 1 %} - tcp://{{ compute.hostname }} - {% endifequal %} - {% ifequal compute.type 2 %} - ssh://{{ compute.hostname }} - {% endifequal %} - {% ifequal compute.type 3 %} - tls://{{ compute.hostname }} - {% endifequal %} - {% ifequal compute.type 4 %} - socket:// - {% endifequal %} -

+
+
+

{% trans "Status:" %}

+
+
+ {% if compute.status %} +

{% trans "Connected" %}

+ {% else %} +

{% trans "Not Connected" %}

+ {% endif %} +
+
-
-
{% endifequal %} {% ifequal compute.type 3 %} @@ -197,13 +191,18 @@ value="{{ host.password }}">
-
{% endifequal %}
diff --git a/templates/create_stg_vol_block.html b/templates/create_stg_vol_block.html new file mode 100644 index 0000000..6353167 --- /dev/null +++ b/templates/create_stg_vol_block.html @@ -0,0 +1,91 @@ +{% load i18n %} +{% if request.user.is_superuser %} + {% ifnotequal state 0 %} + {% ifequal pool "iso" %} + + + + + + + {% else %} + + + + + + + {% endifequal %} + {% endifnotequal %} +{% endif %} \ No newline at end of file diff --git a/templates/instances.html b/templates/instances.html index bbf0b4b..7a49d33 100644 --- a/templates/instances.html +++ b/templates/instances.html @@ -5,6 +5,7 @@
+ {% include 'create_inst_block.html' %}

{% trans "Instances" %}

diff --git a/templates/sidebar.html b/templates/sidebar.html index 22918d8..60e3a52 100644 --- a/templates/sidebar.html +++ b/templates/sidebar.html @@ -8,7 +8,7 @@ {% if request.user.is_superuser %}
  • - {% trans "Coputes" %} + {% trans "Computes" %}
  • {% trans "Users" %} diff --git a/templates/storage.html b/templates/storage.html new file mode 100644 index 0000000..6363a2e --- /dev/null +++ b/templates/storage.html @@ -0,0 +1,201 @@ +{% extends "base.html" %} +{% load i18n %} +{% block title %}{% trans "Storage" %} - {{ pool }}{% endblock %} +{% block content %} + +
    +
    + {% include 'create_stg_vol_block.html' %} +

    {% trans "Storage:" %} {{ pool }}

    + +
    +
    + + + {% include 'errors_block.html' %} + +
    +
    +

    {% trans "Pool name:" %}

    +

    {% trans "Pool type:" %}

    +

    {% trans "Pool path:" %}

    +

    {% trans "Pool status:" %}

    +

    {% trans "Size" %} ({{ size|filesizeformat }} / {{ used|filesizeformat }})

    +

    {% trans "State" %}

    +

    {% trans "Autostart" %}

    +
    +
    +

    {{ pool }}

    +

    {% if not type %}{% trans "None" %}{% else %}{{ type }}{% endif %}

    +

    {% if not path %}{% trans "None" %}{% else %}{{ path }}{% endif %}

    +

    {% if not status %}{% trans "None" %}{% else %}{{ status }}{% endif %}

    +

    {% trans "Usage" %}: {{ percent }}%

    +

    +

    {% csrf_token %} + {% ifequal state 0 %} + + + {% else %} + + {% endifequal %} +
    +

    +

    +

    {% csrf_token %} + {% ifequal autostart 0 %} + + {% else %} + + {% endifequal %} +
    +

    +
    +
    +
    +
    + {% if state %} + + {% if volumes %} +
    + + + + + + + + + + + + {% for volume in volumes %} + + + + + + + + + {% endfor %} + +
    #{% trans "Name" %}{% trans "Size" %}{% trans "Format" %}{% trans "Action" %}
    {{ forloop.counter }}{{ volume.name }}{{ volume.size|filesizeformat }}{{ volume.type }} + + + {% ifnotequal volume.type "iso" %} + + {% else %} + + {% endifnotequal %} + +
    {% csrf_token %} + + +
    +
    +
    + {% else %} +
    +
    + + {% trans "Warning:" %} {% trans "Hypervisor doesn't have any Volumes" %} +
    +
    + {% endif %} + {% endif %} +
    +
    +{% endblock %} +{% block script %} + +{% endblock %} diff --git a/templates/storages.html b/templates/storages.html index fe82b55..4b8dc93 100644 --- a/templates/storages.html +++ b/templates/storages.html @@ -64,6 +64,4 @@ {% endfor %} {% endif %} - - {% endblock %} \ No newline at end of file