processes() commandLine missing spaces fix (windows)
This commit is contained in:
parent
5a2bb71c21
commit
5e79107f90
@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||
| 5.16.7 | 2022-12-21 | `processes()` commandLine missing spaces fix (windows) |
|
||||
| 5.16.6 | 2022-12-12 | `processes()` time format fix (linux) |
|
||||
| 5.16.5 | 2022-12-09 | `inetLatency()` fix for alpine (linux) |
|
||||
| 5.16.4 | 2022-12-09 | `processes()` fix started (linux alpine) |
|
||||
|
||||
@ -57,6 +57,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.16.7</th>
|
||||
<td>2022-12-21</td>
|
||||
<td><span class="code">processes()</span> commandLine missing spaces fix (windows)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.16.6</th>
|
||||
<td>2022-12-12</td>
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
<img class="logo" src="assets/logo.png" alt="logo">
|
||||
<div class="title">systeminformation</div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version">New Version: <span id="version">5.16.6</span></div>
|
||||
<div class="version">New Version: <span id="version">5.16.7</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">
|
||||
@ -212,7 +212,7 @@
|
||||
<div class="title">Downloads last month</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">586</div>
|
||||
<div class="numbers">588</div>
|
||||
<div class="title">Dependents</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -847,7 +847,7 @@ function processes(callback) {
|
||||
let additionalCommand = false;
|
||||
lines.forEach((line) => {
|
||||
if (additionalCommand && line.toLowerCase().startsWith(' ')) {
|
||||
commandLine = commandLine + line.trim();
|
||||
commandLine += ' ' + line.trim();
|
||||
} else {
|
||||
additionalCommand = false;
|
||||
}
|
||||
|
||||
33
lib/util.js
33
lib/util.js
@ -28,7 +28,6 @@ const _windows = (_platform === 'win32');
|
||||
const _freebsd = (_platform === 'freebsd');
|
||||
const _openbsd = (_platform === 'openbsd');
|
||||
const _netbsd = (_platform === 'netbsd');
|
||||
// const _sunos = (_platform === 'sunos');
|
||||
|
||||
let _cores = 0;
|
||||
let wmicPath = '';
|
||||
@ -288,7 +287,7 @@ function parseHead(head, rights) {
|
||||
cap: head.substring(from, to)
|
||||
});
|
||||
let len = result.length;
|
||||
for (var i = 0; i < len; i++) {
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (result[i].cap.replace(/\s/g, '').length === 0) {
|
||||
if (i + 1 < len) {
|
||||
result[i].to = result[i + 1].to;
|
||||
@ -343,21 +342,6 @@ function wmic(command) {
|
||||
});
|
||||
}
|
||||
|
||||
// function wmic(command, options) {
|
||||
// options = options || execOptsWin;
|
||||
// return new Promise((resolve) => {
|
||||
// process.nextTick(() => {
|
||||
// try {
|
||||
// exec(WINDIR + '\\system32\\chcp.com 65001 | ' + getWmic() + ' ' + command, options, function (error, stdout) {
|
||||
// resolve(stdout, error);
|
||||
// }).stdin.end();
|
||||
// } catch (e) {
|
||||
// resolve('', e);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
function getVboxmanage() {
|
||||
return _windows ? `"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"` : 'vboxmanage';
|
||||
}
|
||||
@ -384,8 +368,6 @@ function powerShellProceedResults(data) {
|
||||
for (let i = 0; i < _psCmds.length; i++) {
|
||||
if (_psCmds[i].id === id) {
|
||||
remove = i;
|
||||
// console.log(`----- TIME : ${(new Date() - _psCmds[i].start) * 0.001} s`);
|
||||
|
||||
_psCmds[i].callback(res);
|
||||
}
|
||||
}
|
||||
@ -469,7 +451,6 @@ function powerShell(cmd) {
|
||||
return new Promise((resolve) => {
|
||||
process.nextTick(() => {
|
||||
try {
|
||||
// const start = new Date();
|
||||
const child = spawn('powershell.exe', ['-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'], {
|
||||
stdio: 'pipe',
|
||||
windowsHide: true,
|
||||
@ -493,7 +474,6 @@ function powerShell(cmd) {
|
||||
});
|
||||
child.on('close', function () {
|
||||
child.kill();
|
||||
// console.log(`----- TIME : ${(new Date() - start) * 0.001} s`);
|
||||
|
||||
resolve(result);
|
||||
});
|
||||
@ -1014,7 +994,6 @@ function decodePiCpuinfo(lines) {
|
||||
} else {
|
||||
// new revision code
|
||||
const revision = ('00000000' + getValue(lines, 'revision', ':', true).toLowerCase()).substr(-8);
|
||||
// const revisionStyleNew = hex2bin(revision.substr(2, 1)).substr(4, 1) === '1';
|
||||
const memSizeCode = parseInt(hex2bin(revision.substr(2, 1)).substr(5, 3), 2) || 0;
|
||||
const manufacturer = manufacturerList[parseInt(revision.substr(3, 1), 10)];
|
||||
const processor = processorList[parseInt(revision.substr(4, 1), 10)];
|
||||
@ -1038,7 +1017,7 @@ function decodePiCpuinfo(lines) {
|
||||
function promiseAll(promises) {
|
||||
const resolvingPromises = promises.map(function (promise) {
|
||||
return new Promise(function (resolve) {
|
||||
var payload = new Array(2);
|
||||
let payload = new Array(2);
|
||||
promise.then(function (result) {
|
||||
payload[0] = result;
|
||||
})
|
||||
@ -1051,8 +1030,8 @@ function promiseAll(promises) {
|
||||
});
|
||||
});
|
||||
});
|
||||
var errors = [];
|
||||
var results = [];
|
||||
const errors = [];
|
||||
const results = [];
|
||||
|
||||
// Execute all wrapped Promises
|
||||
return Promise.all(resolvingPromises)
|
||||
@ -1076,7 +1055,7 @@ function promiseAll(promises) {
|
||||
|
||||
function promisify(nodeStyleFunction) {
|
||||
return function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
const args = Array.prototype.slice.call(arguments);
|
||||
return new Promise(function (resolve, reject) {
|
||||
args.push(function (err, data) {
|
||||
if (err) {
|
||||
@ -1092,7 +1071,7 @@ function promisify(nodeStyleFunction) {
|
||||
|
||||
function promisifySave(nodeStyleFunction) {
|
||||
return function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
const args = Array.prototype.slice.call(arguments);
|
||||
return new Promise(function (resolve) {
|
||||
args.push(function (err, data) {
|
||||
resolve(data);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user