From: Michael Tremer Date: Tue, 30 Oct 2018 11:18:35 +0000 (+0000) Subject: fireinfo: Redesign profile page X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e25916277d4b7cc314841ccd40b17e68c7fec76a;p=ipfire.org.git fireinfo: Redesign profile page Signed-off-by: Michael Tremer --- diff --git a/src/backend/fireinfo.py b/src/backend/fireinfo.py index 223468b9..f5c1ad57 100644 --- a/src/backend/fireinfo.py +++ b/src/backend/fireinfo.py @@ -363,12 +363,11 @@ class Device(Object): def __lt__(self, other): if isinstance(other, self.__class__): - return self.subsystem < other.subsystem or \ + return self.cls < other.cls or \ self.vendor_string < other.vendor_string or \ self.vendor < other.vendor or \ self.model_string < other.model_string or \ - self.model < other.model or \ - self.driver < other.driver + self.model < other.model @property def data(self): @@ -727,8 +726,8 @@ class Profile(Object): return False # WiFi module - if self.count_device("usb", "148f", "5572") < 1: - return False + #if self.count_device("usb", "148f", "5572") < 1: + # return False return True diff --git a/src/templates/fireinfo/modules/table-devices.html b/src/templates/fireinfo/modules/table-devices.html index b1c5b2bd..34ec8112 100644 --- a/src/templates/fireinfo/modules/table-devices.html +++ b/src/templates/fireinfo/modules/table-devices.html @@ -1,31 +1,25 @@ -
- {% for d in devices %} -
- {{ d.vendor_string }} - • - - {{ d.model_string or "N/A (%s)" % d.model }} - -
-
-
+

+ {% end %} -
+ diff --git a/src/templates/fireinfo/profile.html b/src/templates/fireinfo/profile.html index 5aeba092..cb86c987 100644 --- a/src/templates/fireinfo/profile.html +++ b/src/templates/fireinfo/profile.html @@ -1,211 +1,176 @@ {% extends "../base.html" %} -{% block title %}{{ _("Profile") }} {{ profile.public_id }}{% end block %} +{% block title %}{{ _("Profile %s") % profile.public_id }}{% end block %} {% block body %} -
-
-

{{ _("Profile") }} {{ profile.public_id }}

- -
-
-

{{ profile.release }}

- -

- {% for zone in profile.network %} - {% if zone == "red" %} - {{ _("RED") }} - {% elif zone == "green" %} - {{ _("GREEN") }} - {% elif zone == "orange" %} - {{ _("ORANGE") }} - {% elif zone == "blue" %} - {{ _("BLUE") }} - {% end %} - {% end %} -

+
+
+
+
+

{{ _("Profile") }}

+
{{ profile.public_id }}
+
- -
+
+
+ +
+
+
{% if profile.appliance_id %} -
-

- {% if profile.appliance_id.startswith("fountainnetworks-") %} - - {{ _("Get yours at") }} - - fountainnetworks.com - - - {% elif profile.appliance_id.startswith("lightningwirelabs-") %} - - {{ _("Get yours at") }} - - lightningwirelabs.com +

{% end %} -
-
- -
-
-

{{ _("Processor") }}

-

{{ profile.processor }}

- {% if profile.processor.count >= 2 %} -

- {% if profile.processor.count == 2 %} - {{ _("Dual-core processor") }} - {% elif profile.processor.count == 4 %} - {{ _("Quad-core processor") }} - {% elif profile.processor.count == 8 %} - {{ ("Octo-core processor") }} - {% else %} - {{ _("%s core processor") % profile.processor.count }} - {% end %} - - {% if profile.processor.uses_ht() %} - {% if profile.processor.vendor == "Intel" %} - {{ _("using Intel Hyper-Threading Technology") }} - {% else %} - {{ _("with %s logical cores") % profile.processor.core_count }} - {% end %} - {% end %} -

- {% end %} - -
    -
  • - {{ _("Supported features") }}: -
  • - {% for cap, available in profile.processor.capabilities %} -
  • - - {% if cap == "64bit" %} - {{ _("64 bit") }} - {% elif cap == "aes" %} - {{ _("AES-NI") }} - {% elif cap == "nx" %} - {{ _("NX") }} - {% elif cap == "pae" %} - {{ _("PAE") }} - {% elif cap == "rdrand" %} - {{ _("RDRAND") }} - {% elif cap == "virt" %} - {{ _("VT-x/AMD-V") }} + +
    +
    +
    +
    +
    + {{ _("Running %s") % profile.release }} +
    + + + {{ _("Last update %s") % locale.format_date(profile.time_updated) }} + +
    + +
    + {% for zone in profile.network %} + {% if zone == "red" %} + {{ _("RED") }} + {% elif zone == "green" %} + {{ _("GREEN") }} + {% elif zone == "orange" %} + {{ _("ORANGE") }} + {% elif zone == "blue" %} + {{ _("BLUE") }} + {% end %} {% end %} - -
  • - {% end %} -
-
- -
-
- {% if profile.virtual %} -
- {{ _("Hypervisor") }} -
-
- {% if profile.hypervisor == "VMWare" %} - {{ _("VMware") }} - {% elif profile.hypervisor is None %} - {{ _("Unknown") }} - {% else %} - {{ profile.hypervisor }} +
+
+ +
+ {% if profile.virtual %} +
{{ _("Hypervisor") }}
+
+ {% if profile.hypervisor == "VMWare" %} + {{ _("VMware") }} + {% elif profile.hypervisor is None %} + {{ _("Unknown") }} + {% else %} + {{ profile.hypervisor }} + {% end %} +
+ {% elif not profile.appliance_id and profile.system %} +
{{ _("System") }}
+
+ {% if profile.system_vendor %} + {{ profile.system_vendor }} + {% end %} + + {% if profile.system_vendor and profile.system_model %} + ‐ + {% end %} + + {% if profile.system_model %} + {{ profile.system_model }} + {% end %} +
{% end %} - - {% elif not profile.appliance_id and profile.system %} - {% if profile.system_vendor %} -
{{ _("Vendor") }}
-
{{ profile.system_vendor }}
- {% end %} - - {% if profile.system_model %} -
{{ _("Model") }}
-
{{ profile.system_model }}
- {% end %} - {% end %} - - {% if profile.memory %} -
- {{ _("Memory") }} -
-
- {% if profile.memory <= (256 * 1024 ** 2) %} - - {% elif profile.memory >= 1024 ** 3 %} - - {% else %} - + + {% if profile.processor %} +
{{ _("Processor") }}
+
+

{{ profile.processor }}

+ +
    + {% for cap, available in profile.processor.capabilities %} +
  • + + {% if cap == "64bit" %} + {{ _("64 bit") }} + {% elif cap == "aes" %} + {{ _("AES-NI") }} + {% elif cap == "nx" %} + {{ _("NX") }} + {% elif cap == "pae" %} + {{ _("PAE") }} + {% elif cap == "rdrand" %} + {{ _("RDRAND") }} + {% elif cap == "virt" %} + {{ _("VT-x/AMD-V") }} + {% end %} + +
  • + {% end %} +
+
{% end %} - {{ format_size(profile.memory) }} - - - {% end %} - - {% if profile.storage %} -
{{ _("System Storage") }}
-
{{ format_size(profile.storage) }}
- {% end %} - - {% if profile.kernel %} -
{{ _("Kernel") }}
-
{{ profile.kernel }}
- {% end %} - - {% if profile.location %} -
- {{ _("Location") }} -
-
- {{ profile.location_string }} -
- {% end %} - - {% if profile.language %} -
- {{ _("Language") }} -
-
{% module LanguageName(profile.language) %}
+ + {% if profile.memory %} +
{{ _("Memory") }}
+
+ {{ format_size(profile.memory) }} +
+ {% end %} + + {% if profile.storage %} +
{{ _("Storage") }}
+
+ {{ format_size(profile.storage) }} +
+ {% end %} + + {% if profile.location %} +
{{ _("Location") }}
+
+ {{ profile.location_string }} +
+ {% end %} + + {% if profile.language %} +
{{ _("Language") }}
+
+ {% module LanguageName(profile.language) %} +
+ {% end %} +
+
+ + {% if profile.devices %} + {% module FireinfoDeviceTable([d for d in profile.devices if d.is_showable()]) %} {% end %} - -
-
- -
-
- {% if profile.devices %} - {% module FireinfoDeviceAndGroupsTable([d for d in profile.devices if d.is_showable()]) %} -
- {% end %} -
-
- -
-
-

{{ _("Signature images") }}

+
+ +
{{ _("Signature images") }}
+
    {% for i in range(1) %} -
  • +
  • - {{ _(
  • {% end %}
-
-

{{ _("Last update") }}: {{ locale.format_date(profile.time_updated) }}

-
-
-
+ {% end block %}