From 1e2b8b1652bb54e75ce71127ab859b776b5b286a Mon Sep 17 00:00:00 2001 From: Modulos Date: Sun, 14 May 2017 12:22:10 +0200 Subject: [PATCH] Add connection error handling --- .../hosting/create_virtual_machine.html | 13 ++- .../templates/hosting/virtual_machines.html | 11 ++- hosting/views.py | 80 +++++++++++++++---- opennebula_api/models.py | 25 ++++-- opennebula_api/serializers.py | 6 +- 5 files changed, 106 insertions(+), 29 deletions(-) diff --git a/hosting/templates/hosting/create_virtual_machine.html b/hosting/templates/hosting/create_virtual_machine.html index 67a61ead..af618740 100644 --- a/hosting/templates/hosting/create_virtual_machine.html +++ b/hosting/templates/hosting/create_virtual_machine.html @@ -5,9 +5,19 @@
+
+
+ {% if messages %} +
+ {% for message in messages %} + {{ message }} + {% endfor %} +
+ {% endif %} +
+ {% if not error %}

{% trans "New Virtual Machine"%}


-
{% csrf_token %}
@@ -34,6 +44,7 @@
+ {% endif %}
diff --git a/hosting/templates/hosting/virtual_machines.html b/hosting/templates/hosting/virtual_machines.html index 2387f89d..e7dee999 100644 --- a/hosting/templates/hosting/virtual_machines.html +++ b/hosting/templates/hosting/virtual_machines.html @@ -7,10 +7,6 @@

{% trans "Virtual Machines"%}

-

- {% trans "Create VM"%} -

-

{% if messages %} @@ -21,6 +17,12 @@
{% endif %} + {% if not error %} +

+ {% trans "Create VM"%} +

+
+ @@ -53,6 +55,7 @@ {% endfor %}
{% trans "ID"%}
+ {% endif %} {% if is_paginated %}