cpuTemperature() fix main (linux)
This commit is contained in:
parent
f4aaaa1924
commit
b336b5aad2
@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| -------------- | -------------- | -------- |
|
||||
| 5.12.4 | 2022-08-09 | `cpuTemperature()` fix main (linux) |
|
||||
| 5.12.3 | 2022-08-04 | `networkInterfaces()` operstate fix (mac OS) |
|
||||
| 5.12.2 | 2022-08-01 | `services()` Ubuntu 22.04 fix |
|
||||
| 5.12.1 | 2022-07-14 | `cpuTemperature()` Apple Silicon support (see docs) |
|
||||
|
||||
@ -57,6 +57,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.12.4</th>
|
||||
<td>2022-08-09</td>
|
||||
<td><span class="code">cpuTemperture()</span> fix main (linux)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.12.3</th>
|
||||
<td>2022-08-04</td>
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
<img class="logo" src="assets/logo.png">
|
||||
<div class="title">systeminformation</div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version">New Version: <span id="version">5.12.3</span></div>
|
||||
<div class="version">New Version: <span id="version">5.12.4</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">
|
||||
|
||||
12
lib/cpu.js
12
lib/cpu.js
@ -1066,9 +1066,9 @@ function cpuTemperature(callback) {
|
||||
});
|
||||
|
||||
if (result.cores.length > 0) {
|
||||
if (result.main === null) {
|
||||
result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
|
||||
}
|
||||
// if (result.main === null) {
|
||||
result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
|
||||
// }
|
||||
let maxtmp = Math.max.apply(Math, result.cores);
|
||||
result.max = (maxtmp > result.main) ? maxtmp : result.main;
|
||||
}
|
||||
@ -1122,9 +1122,9 @@ function cpuTemperature(callback) {
|
||||
}
|
||||
});
|
||||
if (result.cores.length > 0) {
|
||||
if (result.main === null) {
|
||||
result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
|
||||
}
|
||||
// if (result.main === null) {
|
||||
result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
|
||||
// }
|
||||
let maxtmp = Math.max.apply(Math, result.cores);
|
||||
result.max = (maxtmp > result.main) ? maxtmp : result.main;
|
||||
} else {
|
||||
|
||||
@ -496,7 +496,6 @@ function parseLinesDarwinNics(sections) {
|
||||
nic.type = util.getValue(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired';
|
||||
const operstate = util.getValue(section, 'status').toLowerCase();
|
||||
nic.operstate = (operstate === 'active' ? 'up' : (operstate === 'inactive' ? 'down' : 'unknown'));
|
||||
// nic.operstate = util.getValue(section, 'status').toLowerCase().indexOf('active') > -1 ? 'up' : 'down';
|
||||
nic.duplex = util.getValue(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full';
|
||||
if (nic.ip6 || nic.ip4 || nic.mac) {
|
||||
nics.push(nic);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user