]> git.ipfire.org Git - ipfire.org.git/commitdiff
fireinfo: Update design
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Nov 2021 12:11:40 +0000 (12:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 28 Nov 2021 12:11:40 +0000 (12:11 +0000)
I made these changes many months ago and I have no idea what I did here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/fireinfo.py
src/templates/base.html
src/templates/fireinfo/index.html
src/web/fireinfo.py

index d7f78456b9119f97523979168e3f510947069ac2..c92d65efeae3a7a45c238fdc753336fbb667462d 100644 (file)
@@ -1874,14 +1874,6 @@ class Fireinfo(Object):
 
                return sorted(ret, key=lambda x: x[1], reverse=True)
 
-       def get_average_memory_amount(self, when=None):
-               res = self.db.get("WITH profiles AS (SELECT fireinfo_profiles_with_data_at(%s) AS id) \
-                       SELECT AVG(fireinfo_profiles_memory.amount) AS avg FROM profiles \
-                       LEFT JOIN fireinfo_profiles_memory ON profiles.id = fireinfo_profiles_memory.profile_id", when)
-
-               if res:
-                       return res.avg or 0
-
        def get_arch_map(self, when=None):
                res = self.db.query("WITH profiles AS (SELECT fireinfo_profiles_with_data_at(%s) AS id) \
                        SELECT fireinfo_arches.name AS arch, COUNT(*)::float / (SELECT COUNT(*) FROM profiles) AS count \
index 982ce80d57c4f97cd77c36bed34178f37b7a6421..1095be5cdc10830e2c8ed12a3575400ff0fc3d0f 100644 (file)
@@ -25,7 +25,9 @@
                        <nav class="navbar navbar-light navbar-expand-lg">
                                <div class="container">
                                        <a class="navbar-brand" href="/">
-                                               {% if hostname == "nopaste.ipfire.org" %}
+                                               {% if hostname == "fireinfo.ipfire.org" %}
+                                                       IPFire<span class="text-primary">_</span>Fireinfo
+                                               {% elif hostname == "nopaste.ipfire.org" %}
                                                        IPFire<span class="text-primary">_</span>Nopaste
                                                {% elif hostname == "people.ipfire.org" %}
                                                        IPFire<span class="text-primary">_</span>People
@@ -33,9 +35,7 @@
                                                        IPFire<span class="text-primary">_</span>
                                                {% end %}
 
-                                               {% if hostname == "fireinfo.ipfire.org" %}
-                                                       {{ _("Fireinfo") }}
-                                               {% elif hostname == "location.ipfire.org" %}
+                                               {% if hostname == "location.ipfire.org" %}
                                                        {{ _("Location") }}
                                                {% elif hostname == "wiki.ipfire.org" %}
                                                        {{ _("Wiki") }}
index e07cb07d9dc0a7019fd4e0ed99d1e08f509b9f2f..40e86be89b07197f9708445c5429e80e86058a9a 100644 (file)
@@ -3,26 +3,22 @@
 {% block title %}{{ _("Fireinfo") }}{% end block %}
 
 {% block container %}
-       <section>
+       <div class="header">
                <div class="container">
-                       <div class="row">
-                               <div class="col col-lg-8">
-                                       <h1 class="display-2">{{ _("Fireinfo") }}</h1>
+                       <h1>{{ _("Fireinfo") }}</h1>
 
-                                       <p>
-                                               <strong>Fireinfo</strong> is a tool that anonymously collects statistical
-                                               data from IPFire systems
-                                       </p>
+                       <p class="text-muted">
+                               <strong>Fireinfo</strong> is a tool that anonymously collects statistical
+                               data from IPFire systems
+                       </p>
 
-                                       <a class="btn btn-primary btn-lg my-3" href="/profile/random">
-                                               {{ _("Show a Random Profile") }}
-                                       </a>
-                               </div>
-                       </div>
+                       <a class="btn btn-primary btn-block my-3" href="/profile/random">
+                               {{ _("Show a Random Profile") }}
+                       </a>
                </div>
-       </section>
+       </div>
 
-       <section class="inverse">
+       <section>
                <div class="container">
                        <div class="row justify-content-center align-items-center">
                                {% if latest_release %}
                </div>
        </section>
 
-       <section>
+       <section class="bg-light">
                <div class="container">
-                       <div class="row">
-                               <div class="col-12">
-                                       <h4>{{ _("Locations") }}</h4>
-
-                                       <dl class="row">
-                                               {% for country_code, percentage in locations %}
-                                                       {% if percentage >= 0.01 %}
-                                                               <dt class="col-sm-6">
-                                                                       <span class="flag-icon flag-icon-{{ country_code.lower() }} small mr-1"></span>
-                                                                       {{ format_country_name(country_code) }}
-                                                               </dt>
-
-                                                               <dd class="col-sm-6">
-                                                                       {% module ProgressBar(percentage, "success") %}
-                                                               </dd>
-                                                       {% end %}
-                                               {% end %}
-                                       </dl>
-                               </div>
-                       </div>
+                       <h4>{{ _("Locations") }}</h4>
+
+                       <dl class="row">
+                               {% for country_code, percentage in locations %}
+                                       {% if percentage >= 0.01 %}
+                                               <dt class="col-sm-6">
+                                                       <span class="flag-icon flag-icon-{{ country_code.lower() }} small mr-1"></span>
+                                                       {{ format_country_name(country_code) }}
+                                               </dt>
+
+                                               <dd class="col-sm-6">
+                                                       {% module ProgressBar(percentage, "success") %}
+                                               </dd>
+                                       {% end %}
+                               {% end %}
+                       </dl>
 
-                       <div class="row">
-                               <div class="col-12">
-                                       <small>
-                                               {{ _("IPFire is also running in these countries: %s") % locale.list([(format_country_name(c) or c)  for c, p in locations if p < 0.01]) }}
-                                       </small>
-                               </div>
-                       </div>
+                       <p>
+                               {{ _("IPFire is also running in these countries: %s") % locale.list([(format_country_name(c) or c)  for c, p in locations if p < 0.01]) }}
+                       </p>
                </div>
        </section>
 
-       <section class="inverse">
+       <section>
                <div class="container">
-                       <div class="row align-items-center">
-                               <div class="col-12 col-md-6">
-                                       <h4>{{ _("CPU Vendors") }}</h4>
+                       <div class="row">
+                               <div class="col-12 col-lg-6">
+                                       <h4>{{ _("Architectures") }}</h4>
 
                                        <dl class="row">
-                                               {% for name, percentage in cpu_vendors %}
+                                               {% for name, percentage in arches %}
                                                        <dt class="col-sm-3">{{ name }}</dt>
 
                                                        <dd class="col-sm-9">
                                                        </dd>
                                                {% end %}
                                        </dl>
+                               </div>
 
-                                       <a class="btn btn-sm btn-light mb-3" href="/processors">
-                                               {{ _("Processor Features") }}
-                                       </a>
-
-                                       <h4>{{ _("Architectures") }}</h4>
+                               <div class="col-12 col-lg-6">
+                                       <h4>{{ _("CPU Vendors") }}</h4>
 
                                        <dl class="row">
-                                               {% for name, percentage in arches %}
+                                               {% for name, percentage in cpu_vendors %}
                                                        <dt class="col-sm-3">{{ name }}</dt>
 
                                                        <dd class="col-sm-9">
                                                        </dd>
                                                {% end %}
                                        </dl>
-                               </div>
-
-                               <div class="col-12 col-md-6 text-center">
-                                       <h1>{{ format_size(memory_avg * 1024, "MB") }}</h1>
 
-                                       <p class="text-muted">
-                                               {{ _("Average Amount of Memory") }}
-                                       </p>
+                                       <a class="btn btn-sm btn-light btn-block" href="/processors">
+                                               {{ _("Processor Features") }}
+                                       </a>
                                </div>
                        </div>
                </div>
index 2662ed4667b8a5ef3b642111ef37d551e9c05410..1323e7857c3f8ffed035f0b1d2ebf42d53b2f512 100644 (file)
@@ -157,7 +157,6 @@ class IndexHandler(BaseHandler):
                        # Hardware
                        "arches"         : self.fireinfo.get_arch_map(when=self.when),
                        "cpu_vendors"    : self.fireinfo.get_cpu_vendors_map(when=self.when),
-                       "memory_avg"     : self.backend.fireinfo.get_average_memory_amount(when=self.when),
 
                        # Virtualization
                        "hypervisors"    : self.fireinfo.get_hypervisor_map(when=self.when),