cpu() Handle RISC-V CPU Manufacturer and Brand

This commit is contained in:
Sebastian Hildebrandt
2024-12-23 10:26:28 +01:00
parent a943c1df16
commit 778c179dc2
4 changed files with 13 additions and 3 deletions
+5 -2
View File
@@ -1544,8 +1544,11 @@ function networkConnections(callback) {
processes = processes.map((line => { return line.trim().replace(/ +/g, ' '); }));
let lines = stdout.toString().split('\n');
lines.shift();
const header = lines.shift().replace(/ Address/g, '_Address').replace(/ +/g, ' ').split(' ');
let pidPos = header.indexOf('pid');
let pidPos = 8;
if (lines.length > 1 && lines[0].indexOf('pid') > 0) {
const header = (lines.shift() || '').replace(/ Address/g, '_Address').replace(/ +/g, ' ').split(' ');
pidPos = header.indexOf('pid');
}
lines.forEach(function (line) {
line = line.replace(/ +/g, ' ').split(' ');
if (line.length >= 8) {