diff --git a/accounts/templates/accounts/otp_login.html b/accounts/templates/accounts/otp_login.html index 8b4e654..bd7ce61 100644 --- a/accounts/templates/accounts/otp_login.html +++ b/accounts/templates/accounts/otp_login.html @@ -1,30 +1,37 @@ -{% extends 'base.html' %} +{% extends "base.html" %} {% load i18n %} {% load static %} {% load django_bootstrap5 %} -{% block title %}WebVirtCloud{% endblock title %} +{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In with OTP" %}{% endblock title %} -{% block page_heading %}WebVirtCloud{% endblock page_heading %} +{% block style %} + +{% endblock style %} {% block content %} -
-
-
-
- {% if form.errors %} - {% bootstrap_form_errors form %} - {% endif %} - +
{% endblock content %} \ No newline at end of file diff --git a/accounts/templates/login.html b/accounts/templates/login.html index 08c6424..1a7da2d 100644 --- a/accounts/templates/login.html +++ b/accounts/templates/login.html @@ -2,31 +2,35 @@ {% load i18n %} {% load static %} -{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In" %}{% endblock %} + +{% block title %}{% trans "WebVirtCloud" %} - {% trans "Sign In" %}{% endblock title %} {% block style %} {% endblock style %} {% block content %} - -
- {% if form.errors %} -
- - {% trans "Incorrect username or password." %} -
- {% endif %} - + {% endblock %} \ No newline at end of file diff --git a/appsettings/views.py b/appsettings/views.py index 3359cb8..a7b60f3 100644 --- a/appsettings/views.py +++ b/appsettings/views.py @@ -5,7 +5,7 @@ from django.contrib import messages from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.shortcuts import render -from django.utils.translation import gettext_lazy as _ +from django.utils.translation import gettext_noop as _ from logs.views import addlogmsg from appsettings.models import AppSettings diff --git a/computes/models.py b/computes/models.py index f81eafa..86df52a 100644 --- a/computes/models.py +++ b/computes/models.py @@ -48,6 +48,10 @@ class Compute(Model): @cached_property def cpu_count(self): return self.proxy.get_node_info()[3] + + @cached_property + def cpu_usage(self): + return round(self.proxy.get_cpu_usage().get('usage')) @cached_property def ram_size(self): diff --git a/conf/requirements.txt b/conf/requirements.txt index 13d58b5..c227892 100644 --- a/conf/requirements.txt +++ b/conf/requirements.txt @@ -1,12 +1,12 @@ -Django==3.2.18 +Django==3.2.19 django_bootstrap5==23.1 django-login-required-middleware==0.9.0 django-otp==1.1.6 -django-icons==23.1 +django-icons==23.2 django-qr-code==3.1.1 gunicorn==20.1.0 libsass==0.22.0 -libvirt-python==9.2.0 +libvirt-python==9.3.0 lxml==4.9.2 qrcode==7.4.2 rwlock==0.0.7 diff --git a/dev/requirements.txt b/dev/requirements.txt index 78bf6b9..9e2fba3 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -1,8 +1,8 @@ -r ../conf/requirements.txt -coverage==7.2.3 +coverage==7.2.5 django-debug-toolbar==4.0.0 pycodestyle==2.10.0 pyflakes==3.0.1 -pylint==2.17.3 +pylint==2.17.4 yapf==0.33.0 black==23.3.0 diff --git a/instances/templates/allinstances.html b/instances/templates/allinstances.html index 457d9f6..b600db5 100644 --- a/instances/templates/allinstances.html +++ b/instances/templates/allinstances.html @@ -39,8 +39,8 @@ {% if request.user.is_superuser %} diff --git a/instances/templates/create_inst_block.html b/instances/templates/create_inst_block.html index e069773..0077001 100644 --- a/instances/templates/create_inst_block.html +++ b/instances/templates/create_inst_block.html @@ -5,7 +5,7 @@