]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
fireinfo: Some design fixes for ARM.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 30 Sep 2011 21:33:14 +0000 (23:33 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 30 Sep 2011 21:33:14 +0000 (23:33 +0200)
www/templates/stasy-profile-detail.html
www/webapp/backend/stasy.py

index a444095a291928e491e2acbd948e01827d148ec5..b71aa05cc493ef720c0f0d28943654d886f87d09 100644 (file)
                                {{ _("Speed") }}
                        </td>
                        <td class="value">
-                               {{ profile.cpu.speed }} MHz (Bogomips: {{ profile.cpu.bogomips }})
+                               {{ profile.cpu.speed }} MHz
+                               {% if profile.cpu.speed != profile.cpu.bogomips %}
+                                       (Bogomips: {{ profile.cpu.bogomips }})
+                               {% end %}
                        </td>
                </tr>
-               <tr>
-                       <td class="key">
-                               {{ _("Supported features") }}
-                       </td>
-                       <td class="value">
-                               <table class="cpufeatures">
-                                       <tr>
-                                               {% if profile.cpu.capable_64bit %}
-                                                       <td class="enabled">
-                                               {% else %}
-                                                       <td class="disabled">
-                                               {% end %}
-                                                       {{ _("64 bit")  }}
-                                               <td>
-                                               
-                                               {% if profile.cpu.capable_pae %}
-                                                       <td class="enabled">
-                                               {% else %}
-                                                       <td class="disabled">
-                                               {% end %}
-                                                       {{ _("PAE")  }}
-                                               <td>
+               {% if profile.cpu.vendor != "ARM" %}
+                       <tr>
+                               <td class="key">
+                                       {{ _("Supported features") }}
+                               </td>
+                               <td class="value">
+                                       <table class="cpufeatures">
+                                               <tr>
+                                                       {% if profile.cpu.capable_64bit %}
+                                                               <td class="enabled">
+                                                       {% else %}
+                                                               <td class="disabled">
+                                                       {% end %}
+                                                               {{ _("64 bit")  }}
+                                                       <td>
 
-                                               {% if profile.cpu.capable_virt %}
-                                                       <td class="enabled">
-                                               {% else %}
-                                                       <td class="disabled">
-                                               {% end %}
-                                                       {{ _("VT-x/AMD-V")  }}
-                                               <td>
-                                       </tr>
-                               </table>
-                       </td>
-               </tr>
+                                                       {% if profile.cpu.capable_pae %}
+                                                               <td class="enabled">
+                                                       {% else %}
+                                                               <td class="disabled">
+                                                       {% end %}
+                                                               {{ _("PAE")  }}
+                                                       <td>
+
+                                                       {% if profile.cpu.capable_virt %}
+                                                               <td class="enabled">
+                                                       {% else %}
+                                                               <td class="disabled">
+                                                       {% end %}
+                                                               {{ _("VT-x/AMD-V")  }}
+                                                       <td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+               {% end %}
                <tr>
                        <td colspan="2">
                                <strong>{{ _("Memory") }}<strong>
index 192d20f380418bef481097c64b316d74e7913e99..ca6b5ce4387063c5d9e8019eed15287f106f690a 100644 (file)
@@ -60,6 +60,9 @@ CPU_STRINGS = (
 
        # Qemu
        (r"QEMU Virtual CPU version .*", r"QEMU CPU"),
+
+       # ARM
+       (r"Feroceon .*", r"ARM Feroceon"),
 )
 
 CPU_CORES = range(1, 9)
@@ -82,7 +85,14 @@ class ProfileCPU(ProfileDict):
 
        @property
        def speed(self):
-               return self._data.get("speed")
+               speed = self._data.get("speed")
+
+               # ARM boxes do not report speed but
+               # bogomips equals speed
+               if not speed:
+                       return self.bogomips
+
+               return speed
 
        @property
        def friendly_speed(self):
@@ -135,7 +145,12 @@ class ProfileCPU(ProfileDict):
 
        @property
        def friendly_string(self):
-               return "%s @ %s" % (self.friendly_vendor, self.friendly_speed)
+               s = self.friendly_vendor
+
+               if self.speed:
+                       s += " @ %s" % self.friendly_speed
+
+               return s
 
 
 class ProfileHypervisor(ProfileDict):