]> git.ipfire.org Git - ipfire.org.git/commitdiff
fireinfo: Show amount of active profiles
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Feb 2020 18:01:55 +0000 (18:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 3 Feb 2020 18:01:55 +0000 (18:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/fireinfo/admin.html
src/web/fireinfo.py

index 66269ba8fcd6b33bfb9d25f0930df77c4c926f95..00a5442504e9d34285521a3d8cd33ad8af8b2a4f 100644 (file)
@@ -6,12 +6,14 @@
        <section>
                <div class="container">
                        <div class="row">
-                               <div class="col col-lg-8">
-                                       <h1 class="display-2">{{ "{:,d}".format(count) }}</h1>
+                               <div class="col col-lg-6 text-center">
+                                       <h1>{{ "{:,d}".format(total) }}</h1>
+                                       <h4>{{ _("Total amount of profiles") }}</h4>
+                               </div>
 
-                                       <p>
-                                               {{ _("Total amount of systems reporting back to Fireinfo") }}
-                                       </p>
+                               <div class="col col-lg-6 text-center">
+                                       <h1>{{ "%.2f%%" % (with_data * 100 / total) }}</h1>
+                                       <h4>{{ _("Reporting back to us") }}</h4>
                                </div>
                        </div>
                </div>
index a6a9858ab529668bc67fcc52fb4c5145bec6065c..33fc5669d6a0db81014f0c3289cf13da2b44f1a9 100644 (file)
@@ -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)