From dc83842528360f9b51ca5ed103827b018c2d4c3e Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 3 Feb 2020 18:01:55 +0000 Subject: [PATCH] fireinfo: Show amount of active profiles Signed-off-by: Michael Tremer --- src/templates/fireinfo/admin.html | 12 +++++++----- src/web/fireinfo.py | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/templates/fireinfo/admin.html b/src/templates/fireinfo/admin.html index 66269ba8..00a54425 100644 --- a/src/templates/fireinfo/admin.html +++ b/src/templates/fireinfo/admin.html @@ -6,12 +6,14 @@
-
-

{{ "{:,d}".format(count) }}

+
+

{{ "{:,d}".format(total) }}

+

{{ _("Total amount of profiles") }}

+
-

- {{ _("Total amount of systems reporting back to Fireinfo") }} -

+
+

{{ "%.2f%%" % (with_data * 100 / total) }}

+

{{ _("Reporting back to us") }}

diff --git a/src/web/fireinfo.py b/src/web/fireinfo.py index a6a9858a..33fc5669 100644 --- a/src/web/fireinfo.py +++ b/src/web/fireinfo.py @@ -296,6 +296,6 @@ class AdminIndexHandler(BaseHandler): @tornado.web.authenticated def get(self): - count = self.backend.fireinfo.get_profile_count() + with_data, total = self.backend.fireinfo.get_active_profiles() - self.render("fireinfo/admin.html", count=count) + self.render("fireinfo/admin.html", with_data=with_data, total=total) -- 2.39.2