cpu() bug fix speed parsing

This commit is contained in:
Sebastian Hildebrandt 2020-12-02 09:07:40 +01:00
parent 22f48346e8
commit 8eda5d5e47
4 changed files with 8 additions and 2 deletions

View File

@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 4.30.11 | 2020-12-02 | `cpu()` bug fix speed parsing |
| 4.30.10 | 2020-12-01 | `cpu()` handled speed parsing error (Apple Silicon) |
| 4.30.9 | 2020-12-01 | `cpu()` corrected processor names (Raspberry Pi) |
| 4.30.8 | 2020-11-30 | `fsSize()` catch error (mac OS) |

View File

@ -83,6 +83,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">4.30.11</th>
<td>2020-12-02</td>
<td><span class="code">cpu()</span> bugfix speed parsing</td>
</tr>
<tr>
<th scope="row">4.30.10</th>
<td>2020-12-01</td>

View File

@ -169,7 +169,7 @@
<img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span></div>
<div class="version">Current Version: <span id="version">4.30.10</span></div>
<div class="version">Current Version: <span id="version">4.30.11</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">

View File

@ -415,7 +415,7 @@ function getCpu() {
const modelline = util.getValue(lines, 'machdep.cpu.brand_string');
const modellineParts = modelline.split('@');
result.brand = modellineParts[0].trim();
result.speed = modellineParts[1] ? modellineParts.trim() : '0';
result.speed = modellineParts[1] ? modellineParts[1].trim() : '0';
result.speed = parseFloat(result.speed.replace(/GHz+/g, '')).toFixed(2);
_cpu_speed = result.speed;
result = cpuBrandManufacturer(result);