diff --git a/accounts/templates/login.html b/accounts/templates/login.html index 08c6424..b81a63e 100644 --- a/accounts/templates/login.html +++ b/accounts/templates/login.html @@ -9,24 +9,27 @@ {% endblock style %} {% block content %} - -
- {% if form.errors %} -
- - {% trans "Incorrect username or password." %} -
- {% endif %} -
{% csrf_token %} - - - - -
- -
-
+
+ +
+ {% 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/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..6ef1915 100644 --- a/instances/templates/create_inst_block.html +++ b/instances/templates/create_inst_block.html @@ -5,7 +5,7 @@