From 0c8a0523a87cf056b94450a688c51f683fdd11e8 Mon Sep 17 00:00:00 2001 From: catborise Date: Fri, 17 Jan 2020 16:14:28 +0300 Subject: [PATCH 01/12] show snapshot list while instance is running. User wanto to see list of running snapshot and delete it. --- instances/templates/instance.html | 89 +++++++++++++++---------------- 1 file changed, 43 insertions(+), 46 deletions(-) diff --git a/instances/templates/instance.html b/instances/templates/instance.html index f7d19cc..968d307 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -549,54 +549,51 @@ {% endifequal %}
- {% ifequal status 5 %} - {% if snapshots %} -

{% trans "Choose a snapshot for restore/delete" %}

-
- - - - - - - - {% for snap in snapshots %} - - - - - + + + {% endfor %} + +
{% trans "Name" %}{% trans "Date" %}{% trans "Action" %}
{{ snap.name }}{{ snap.date|date:"M d H:i:s" }} -
{% csrf_token %} - - {% ifequal status 5 %} - - {% else %} - - {% endifequal %} -
-
-
{% csrf_token %} - - + {% endifequal %} + +
+
{% csrf_token %} + + +
+
+
{% else %} -

{% trans "To restore snapshots you need Power Off the instance." %}

- {% endifequal %} +

{% trans "You do not have any snapshots" %}

+ {% endif %}
From 70032fc2e1a8cf2dd11062889b9355c987eae54d Mon Sep 17 00:00:00 2001 From: catborise Date: Mon, 20 Jan 2020 15:47:14 +0300 Subject: [PATCH 02/12] re organize instance overview. add snapshot indicator if there is... add bottom bar for navigation. --- instances/templates/instance.html | 124 ++++++++++++++++++------------ 1 file changed, 74 insertions(+), 50 deletions(-) diff --git a/instances/templates/instance.html b/instances/templates/instance.html index 968d307..6cc510f 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -4,61 +4,85 @@ {% block title %}{% trans "Instance" %} - {{ vname }}{% endblock %} {% block content %} {% include 'pleasewaitdialog.html' %} + -
+
-

- {{ vname }}{% if title %} ({{ title }}){% endif %} -

+

{{ vname }}{% if title %} ({{ title }}){% endif %}

-
- {% if status == 5 %} - {% trans "Off" %} - {% endif %} - {% if status == 1 %} - {% trans "Active" %} - {% endif %} - {% if status == 3 %} - {% trans "Suspend" %} - {% endif %} - | - {% if cur_vcpu %} - {{ cur_vcpu }} {% trans "Vcpu" %} - {% else %} - {{ vcpu }} {% trans "Vcpu" %} - {% endif %} - | - {{ cur_memory }} {% trans "MB" %} {% trans "Ram" %} - | - {% for disk in disks %} - {{ disk.size|filesizeformat }} {% trans "Disk" %} | - {% endfor %} - {% for net in networks %} - {% for ipv4 in net.ipv4|default:"-" %} - {{ ipv4 }} | - {% endfor %} - {% endfor %} - - | - - on - {{ compute.name }}{% if compute.name != compute.hostname %} - {{ compute.hostname }}{% endif %} -
+ class="fa fa-plug text-warning" + title="Guest Agent Enabled but not Connected" + {% endif %} + {% else %} + class="fa fa-plug text-danger" + title="Guest Agent Not Enabled & Not Connected" + {% endif %}> + + | + {% if snapshots %} + | + {% endif %} + {% if cur_vcpu %} + {{ cur_vcpu }} {% trans "Vcpu" %} + {% else %} + {{ vcpu }} {% trans "Vcpu" %} + {% endif %} + | + {{ cur_memory }} {% trans "MB" %} {% trans "Ram" %} + | + {% for disk in disks %} + {{ disk.size|filesizeformat }} {% trans "Disk" %} | + {% endfor %} + {% for net in networks %} + {% for ipv4 in net.ipv4 %} + {{ ipv4 }} | + {% endfor %} + {% endfor %} +
{% if user_quota_msg %} {{ user_quota_msg|capfirst }} {% trans "quota reached" %}. From c79a6359238b5e0411054a0b397ca489965bc250 Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 21 Jan 2020 15:26:35 +0300 Subject: [PATCH 03/12] change compute name, hostaname, details char size. url.py typo fix --- .../migrations/0003_auto_20200121_1523.py | 30 +++++++++++++++++++ computes/models.py | 2 +- webvirtcloud/urls.py | 4 +-- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 computes/migrations/0003_auto_20200121_1523.py diff --git a/computes/migrations/0003_auto_20200121_1523.py b/computes/migrations/0003_auto_20200121_1523.py new file mode 100644 index 0000000..361cbc1 --- /dev/null +++ b/computes/migrations/0003_auto_20200121_1523.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.26 on 2020-01-21 12:23 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('computes', '0002_compute_details'), + ] + + operations = [ + migrations.AlterField( + model_name='compute', + name='details', + field=models.CharField(blank=True, max_length=64, null=True), + ), + migrations.AlterField( + model_name='compute', + name='hostname', + field=models.CharField(max_length=64), + ), + migrations.AlterField( + model_name='compute', + name='name', + field=models.CharField(max_length=64), + ), + ] diff --git a/computes/models.py b/computes/models.py index 4ac22f3..1a83e59 100644 --- a/computes/models.py +++ b/computes/models.py @@ -6,7 +6,7 @@ class Compute(models.Model): hostname = models.CharField(max_length=64) login = models.CharField(max_length=20) password = models.CharField(max_length=14, blank=True, null=True) - details = models.CharField(max_length=50, null=True, blank=True) + details = models.CharField(max_length=64, null=True, blank=True) type = models.IntegerField() def __unicode__(self): diff --git a/webvirtcloud/urls.py b/webvirtcloud/urls.py index a7da7dc..4924a68 100644 --- a/webvirtcloud/urls.py +++ b/webvirtcloud/urls.py @@ -12,8 +12,6 @@ urlpatterns = [ url(r'^computes/', include('computes.urls')), url(r'^logs/', include('logs.urls')), url(r'^datasource/', include('datasource.urls')), - - url(r'^console/$', console, name='console'), - # (r'^admin/', include(admin.site.urls)), + #url(r'^admin/', include(admin.site.urls)), ] From 9198615076a5f861ea25638167038a5212ee0c81 Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 21 Jan 2020 15:39:16 +0300 Subject: [PATCH 04/12] guest agent status indicator changed --- instances/templates/instance.html | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/instances/templates/instance.html b/instances/templates/instance.html index 6cc510f..4b9544c 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -19,12 +19,12 @@