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 \
<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
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") }}
{% 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>