From fbf12f65f22d9af29677cd3407e2edbf4ae5d9f6 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Thu, 12 Dec 2019 14:19:39 +0100 Subject: [PATCH] Update dashboard to use retrieved domains data. --- musician/templates/musician/dashboard.html | 9 +++++++-- musician/views.py | 14 ++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/musician/templates/musician/dashboard.html b/musician/templates/musician/dashboard.html index c6cec5a..d9cbb97 100644 --- a/musician/templates/musician/dashboard.html +++ b/musician/templates/musician/dashboard.html @@ -54,7 +54,7 @@

{% trans "Mail" %}

- 3 mail addresses created
+ {{ domain.mails|length }} {% trans "mail addresses created" %}
1 mail address left

@@ -66,8 +66,13 @@

{% trans "Databases" %}

- 1 database created
+ 0 {% trans "databases created" %} + {% comment %} + + {% endcomment %}

diff --git a/musician/views.py b/musician/views.py index 9ce35e4..5b39f50 100644 --- a/musician/views.py +++ b/musician/views.py @@ -27,9 +27,7 @@ class DashboardView(CustomContextMixin, UserTokenRequiredMixin, TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - - # TODO retrieve all data needed from orchestra - raw_domains = self.orchestra.retrieve_service_list('domain') + domains = self.orchestra.retrieve_domain_list() # TODO(@slamora) update when backend provides resource usage data resource_usage = { @@ -56,19 +54,11 @@ class DashboardView(CustomContextMixin, UserTokenRequiredMixin, TemplateView): }, } - for domain in raw_domains: - domain['usage'] = { - 'usage': 300, - 'total': 650, - 'unit': 'MB', - 'percent': 50, - } - # TODO(@slamora) update when backend supports notifications notifications = [] context.update({ - 'domains': raw_domains, + 'domains': domains, 'resource_usage': resource_usage, 'notifications': notifications, })