getAllData() added wifiNetworks

This commit is contained in:
Sebastian Hildebrandt 2020-05-12 16:00:02 +02:00
parent 1fd784f219
commit 5f2beb701b
2 changed files with 10 additions and 3 deletions

View File

@ -767,7 +767,7 @@ function cpuTemperature(callback) {
for (let i = 0; i < temps.length; i++) { for (let i = 0; i < temps.length; i++) {
if (temps[i] && (labels[i] === undefined || (labels[i] && labels[i].toLowerCase().startsWith('core')))) { if (temps[i] && (labels[i] === undefined || (labels[i] && labels[i].toLowerCase().startsWith('core')))) {
result.cores.push(Math.round(parseInt(temps[i], 10) / 100) / 10); result.cores.push(Math.round(parseInt(temps[i], 10) / 100) / 10);
} else if (temps[i] && labels[i] && result.main === -1) { } else if (temps[i] && labels[i] && result.main === -1) {
result.main = Math.round(parseInt(temps[i], 10) / 100) / 10; result.main = Math.round(parseInt(temps[i], 10) / 100) / 10;
} }
} }

11
lib/index.js Normal file → Executable file
View File

@ -140,8 +140,8 @@ function getDynamicData(srv, iface, callback) {
// use closure to track ƒ completion // use closure to track ƒ completion
let functionProcessed = (function () { let functionProcessed = (function () {
let totalFunctions = 14; let totalFunctions = 15;
if (_windows) totalFunctions = 10; if (_windows) totalFunctions = 11;
if (_freebsd || _openbsd || _netbsd) totalFunctions = 11; if (_freebsd || _openbsd || _netbsd) totalFunctions = 11;
if (_sunos) totalFunctions = 6; if (_sunos) totalFunctions = 6;
@ -260,6 +260,13 @@ function getDynamicData(srv, iface, callback) {
}); });
} }
if (!_openbsd && !_freebsd && !_netbsd && !_sunos) {
wifi.wifiNetworks().then(res => {
data.wifiNetworks = res;
functionProcessed();
});
}
internet.inetLatency().then(res => { internet.inetLatency().then(res => {
data.inetLatency = res; data.inetLatency = res;
functionProcessed(); functionProcessed();