improvements after test win, linux
This commit is contained in:
parent
cfd811bc62
commit
142a0b5557
@ -190,6 +190,7 @@ function fsOpenFiles(callback) {
|
|||||||
result.allocated = parseInt(parts[0], 10);
|
result.allocated = parseInt(parts[0], 10);
|
||||||
result.available = parseInt(parts[1], 10);
|
result.available = parseInt(parts[1], 10);
|
||||||
result.max = parseInt(parts[2], 10);
|
result.max = parseInt(parts[2], 10);
|
||||||
|
if (!result.available) { result.available = result.max - result.allocated; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -531,7 +531,7 @@ function graphics(callback) {
|
|||||||
start += 36;
|
start += 36;
|
||||||
}
|
}
|
||||||
result.resolutionX = parseInt('0x0' + edid.substr(start + 8, 1) + edid.substr(start + 4, 2));
|
result.resolutionX = parseInt('0x0' + edid.substr(start + 8, 1) + edid.substr(start + 4, 2));
|
||||||
result.resolutionX = parseInt('0x0' + edid.substr(start + 14, 1) + edid.substr(start + 10, 2));
|
result.resolutionY = parseInt('0x0' + edid.substr(start + 14, 1) + edid.substr(start + 10, 2));
|
||||||
result.sizeX = parseInt('0x0' + edid.substr(start + 28, 1) + edid.substr(start + 24, 2));
|
result.sizeX = parseInt('0x0' + edid.substr(start + 28, 1) + edid.substr(start + 24, 2));
|
||||||
result.sizeY = parseInt('0x0' + edid.substr(start + 29, 1) + edid.substr(start + 26, 2));
|
result.sizeY = parseInt('0x0' + edid.substr(start + 29, 1) + edid.substr(start + 26, 2));
|
||||||
// monitor name
|
// monitor name
|
||||||
|
|||||||
@ -356,7 +356,7 @@ function isUefiLinux() {
|
|||||||
exec('dmesg | grep -E "EFI v|UEFI"', function (error, stdout) {
|
exec('dmesg | grep -E "EFI v|UEFI"', function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
const lines = stdout.toString().split('\n');
|
const lines = stdout.toString().split('\n');
|
||||||
return (lines.length > 0);
|
resolve(lines.length > 0);
|
||||||
}
|
}
|
||||||
resolve(false);
|
resolve(false);
|
||||||
});
|
});
|
||||||
@ -375,6 +375,14 @@ function isUefiWindows() {
|
|||||||
const line = stdout.toString().split('\n\r')[0];
|
const line = stdout.toString().split('\n\r')[0];
|
||||||
resolve(line.toLowerCase().indexOf('uefi') >= 0);
|
resolve(line.toLowerCase().indexOf('uefi') >= 0);
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
exec('$env:firmware_type', util.execOptsWin, function (error, stdout) {
|
||||||
|
if (!error) {
|
||||||
|
const line = stdout.toString() || '';
|
||||||
|
resolve(line.toLowerCase().indexOf('uefi') >= 0);
|
||||||
|
}
|
||||||
|
resolve(false);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
resolve(false);
|
resolve(false);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -945,10 +945,22 @@ function processLoad(proc, callback) {
|
|||||||
cpus: 0,
|
cpus: 0,
|
||||||
mem
|
mem
|
||||||
});
|
});
|
||||||
if (processesString === '*' || processes.indexOf(name.toLowerCase()) >= 0) {
|
let pname = '';
|
||||||
|
let inList = false;
|
||||||
|
processes.forEach(function (proc) {
|
||||||
|
// console.log(proc)
|
||||||
|
// console.log(item)
|
||||||
|
// inList = inList || item.name.toLowerCase() === proc.toLowerCase();
|
||||||
|
if (name.toLowerCase().indexOf(proc.toLowerCase()) >= 0 && !inList) {
|
||||||
|
inList = true;
|
||||||
|
pname = proc;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (processesString === '*' || inList) {
|
||||||
let processFound = false;
|
let processFound = false;
|
||||||
result.forEach(function (item) {
|
result.forEach(function (item) {
|
||||||
if (item.proc.toLowerCase() === name.toLowerCase()) {
|
if (item.proc.toLowerCase() === pname.toLowerCase()) {
|
||||||
item.pids.push(pid);
|
item.pids.push(pid);
|
||||||
item.mem += mem / os.totalmem() * 100;
|
item.mem += mem / os.totalmem() * 100;
|
||||||
processFound = true;
|
processFound = true;
|
||||||
@ -956,7 +968,7 @@ function processLoad(proc, callback) {
|
|||||||
})
|
})
|
||||||
if (!processFound) {
|
if (!processFound) {
|
||||||
result.push({
|
result.push({
|
||||||
proc: name,
|
proc: pname,
|
||||||
pid: pid,
|
pid: pid,
|
||||||
pids: [pid],
|
pids: [pid],
|
||||||
cpu: 0,
|
cpu: 0,
|
||||||
@ -969,7 +981,9 @@ function processLoad(proc, callback) {
|
|||||||
// add missing processes
|
// add missing processes
|
||||||
if (processesString !== '*') {
|
if (processesString !== '*') {
|
||||||
let processesMissing = processes.filter(function (name) {
|
let processesMissing = processes.filter(function (name) {
|
||||||
return procStats.filter(function(item) { return item.name.toLowerCase() === name }).length === 0;
|
// return procStats.filter(function(item) { return item.name.toLowerCase() === name }).length === 0;
|
||||||
|
return procStats.filter(function (item) { return item.name.toLowerCase().indexOf(name) >= 0 }).length === 0;
|
||||||
|
|
||||||
});
|
});
|
||||||
processesMissing.forEach(function (procName) {
|
processesMissing.forEach(function (procName) {
|
||||||
result.push({
|
result.push({
|
||||||
@ -986,7 +1000,7 @@ function processLoad(proc, callback) {
|
|||||||
for (let i = 0; i < procStats.length; i++) {
|
for (let i = 0; i < procStats.length; i++) {
|
||||||
let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _process_cpu);
|
let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _process_cpu);
|
||||||
|
|
||||||
let listPos = 0;
|
let listPos = -1;
|
||||||
for (let j = 0; j < result.length; j++) {
|
for (let j = 0; j < result.length; j++) {
|
||||||
if (result[j].pid === resultProcess.pid || result[j].pids.indexOf(resultProcess.pid) >= 0) { listPos === j; }
|
if (result[j].pid === resultProcess.pid || result[j].pids.indexOf(resultProcess.pid) >= 0) { listPos === j; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ function test(f) {
|
|||||||
else if (f === 'g') { si.graphics().then(data => { if (data !== null) { resolve({ data, title: 'Graphics' }); } else { resolve('not_supported') } }) }
|
else if (f === 'g') { si.graphics().then(data => { if (data !== null) { resolve({ data, title: 'Graphics' }); } else { resolve('not_supported') } }) }
|
||||||
else if (f === 'h') { si.bluetoothDevices().then(data => { if (data !== null) { resolve({ data, title: 'Bluetooth' }); } else { resolve('not_supported') } }) }
|
else if (f === 'h') { si.bluetoothDevices().then(data => { if (data !== null) { resolve({ data, title: 'Bluetooth' }); } else { resolve('not_supported') } }) }
|
||||||
else if (f === 'i') { si.inetLatency().then(data => { if (data !== null) { resolve({ data, title: 'Internet Latency' }); } else { resolve('not_supported') } }) }
|
else if (f === 'i') { si.inetLatency().then(data => { if (data !== null) { resolve({ data, title: 'Internet Latency' }); } else { resolve('not_supported') } }) }
|
||||||
else if (f === 'I') { si.inetChecksite('www.plus-innovations.com').then(data => { if (data !== null) { resolve({ data, title: 'Internet Check Site' }); } else { resolve('not_supported') } }) }
|
else if (f === 'I') { si.inetChecksite('https://www.plus-innovations.com').then(data => { if (data !== null) { resolve({ data, title: 'Internet Check Site' }); } else { resolve('not_supported') } }) }
|
||||||
else if (f === 'j') { si.cpuCurrentSpeed().then(data => { if (data !== null) { resolve({ data, title: 'CPU Current Speed' }); } else { resolve('not_supported') } }) }
|
else if (f === 'j') { si.cpuCurrentSpeed().then(data => { if (data !== null) { resolve({ data, title: 'CPU Current Speed' }); } else { resolve('not_supported') } }) }
|
||||||
else if (f === 'l') { si.currentLoad().then(data => { if (data !== null) { resolve({ data, title: 'CPU Current Load' }); } else { resolve('not_supported') } }) }
|
else if (f === 'l') { si.currentLoad().then(data => { if (data !== null) { resolve({ data, title: 'CPU Current Load' }); } else { resolve('not_supported') } }) }
|
||||||
else if (f === 'L') { si.fullLoad().then(data => { if (data !== null) { resolve({ data, title: 'CPU Full Load' }); } else { resolve('not_supported') } }) }
|
else if (f === 'L') { si.fullLoad().then(data => { if (data !== null) { resolve({ data, title: 'CPU Full Load' }); } else { resolve('not_supported') } }) }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user