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..c2ba7e5 100644 --- a/instances/templates/allinstances.html +++ b/instances/templates/allinstances.html @@ -25,12 +25,10 @@ {% endif %} {% endfor %}
- {% if 'instances.view_instances' in perms %} - {% if app_settings.VIEW_INSTANCES_LIST_STYLE == 'grouped' and request.user.is_superuser %} - {% include 'allinstances_index_grouped.html' %} - {% else %} - {% include 'allinstances_index_nongrouped.html' %} - {% endif %} + {% if app_settings.VIEW_INSTANCES_LIST_STYLE == 'grouped' and request.user.is_superuser or 'instances.view_instances' in perms %} + {% include 'allinstances_index_grouped.html' %} + {% else %} + {% include 'allinstances_index_nongrouped.html' %} {% endif %}
{% endblock content %} @@ -39,8 +37,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 @@