cpuTemperature() fixed issue windows
This commit is contained in:
@@ -784,6 +784,7 @@ function cpuTemperature(callback) {
|
||||
}
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
return;
|
||||
}
|
||||
}
|
||||
exec('sensors', function (error, stdout) {
|
||||
@@ -819,6 +820,7 @@ function cpuTemperature(callback) {
|
||||
if (result.main !== -1.0 || result.max !== -1.0) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
return;
|
||||
}
|
||||
}
|
||||
fs.stat('/sys/class/thermal/thermal_zone0/temp', function (err) {
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ function dockerInfo(callback) {
|
||||
result.cgroupDriver = data.CgroupDriver;
|
||||
result.nEventsListener = data.NEventsListener;
|
||||
result.kernelVersion = data.KernelVersion;
|
||||
result.pperatingSystem = data.OperatingSystem;
|
||||
result.operatingSystem = data.OperatingSystem;
|
||||
result.osType = data.OSType;
|
||||
result.architecture = data.Architecture;
|
||||
result.ncpu = data.NCPU;
|
||||
|
||||
+7
-7
@@ -586,13 +586,13 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
|
||||
|
||||
let dhcStatus = resultFormat.split(' ').slice(1).toString();
|
||||
switch (dhcStatus) {
|
||||
case 'auto':
|
||||
result = true;
|
||||
break;
|
||||
case 'auto':
|
||||
result = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
} catch (e) {
|
||||
@@ -679,7 +679,7 @@ function testVirtualNic(iface, ifaceName, mac) {
|
||||
|
||||
function networkInterfaces(callback, rescan = true) {
|
||||
|
||||
if (typeof callback === "boolean") {
|
||||
if (typeof callback === 'boolean') {
|
||||
rescan = callback;
|
||||
callback = null;
|
||||
}
|
||||
|
||||
+2
-2
@@ -324,8 +324,7 @@ function isUefiLinux() {
|
||||
fs.stat('/sys/firmware/efi', function (err) {
|
||||
if (!err) {
|
||||
resolve(true);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
@@ -341,6 +340,7 @@ function isUefiWindows() {
|
||||
if (!error) {
|
||||
const line = stdout.toString().split('\n\r')[0];
|
||||
resolve(line.toLowerCase().indexOf('uefi') >= 0);
|
||||
return;
|
||||
}
|
||||
resolve(false);
|
||||
});
|
||||
|
||||
+5
-1
@@ -332,7 +332,11 @@ function powerShell(cmd) {
|
||||
process.nextTick(() => {
|
||||
try {
|
||||
const child = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {
|
||||
stdio: 'pipe'
|
||||
stdio: 'pipe',
|
||||
windowsHide: true,
|
||||
maxBuffer: 1024 * 20000,
|
||||
encoding: 'UTF-8',
|
||||
env: util._extend({}, process.env, { LANG: 'en_US.UTF-8' })
|
||||
});
|
||||
|
||||
if (child && !child.pid) {
|
||||
|
||||
Reference in New Issue
Block a user