processes() fixed issue truncated params
This commit is contained in:
parent
40b16dac9a
commit
be0a5c66af
@ -72,6 +72,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 5.2.5 | 2020-02-11 | `processes()` fixed truncated params (linux) |
|
||||||
| 5.2.4 | 2020-02-11 | `currentLoad()` fixed issue |
|
| 5.2.4 | 2020-02-11 | `currentLoad()` fixed issue |
|
||||||
| 5.2.3 | 2020-02-11 | `diskLayout()` added USB drives (mac OS) |
|
| 5.2.3 | 2020-02-11 | `diskLayout()` added USB drives (mac OS) |
|
||||||
| 5.2.2 | 2020-02-11 | code cleanup, updated docs |
|
| 5.2.2 | 2020-02-11 | code cleanup, updated docs |
|
||||||
|
|||||||
@ -56,6 +56,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.2.5</th>
|
||||||
|
<td>2020-02-11</td>
|
||||||
|
<td><span class="code">processes()</span> fix truncated params (linux)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.2.4</th>
|
<th scope="row">5.2.4</th>
|
||||||
<td>2020-02-11</td>
|
<td>2020-02-11</td>
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span> </div>
|
<div class="subtitle"><span id="typed"></span> </div>
|
||||||
<div class="version">New Version: <span id="version">5.2.4</span></div>
|
<div class="version">New Version: <span id="version">5.2.5</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>
|
<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>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
|
|||||||
@ -525,38 +525,40 @@ function processes(callback) {
|
|||||||
checkColumn(11);
|
checkColumn(11);
|
||||||
const user = line.substring(parsedhead[11].from + offset, parsedhead[11].to + offset2).trim();
|
const user = line.substring(parsedhead[11].from + offset, parsedhead[11].to + offset2).trim();
|
||||||
checkColumn(12);
|
checkColumn(12);
|
||||||
let fullcommand = line.substring(parsedhead[12].from + offset, parsedhead[12].to + offset2).trim();
|
|
||||||
if (fullcommand.substr(0, 1) === '[') { fullcommand = fullcommand.substring(1); }
|
|
||||||
if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }
|
|
||||||
let cmdPath = '';
|
let cmdPath = '';
|
||||||
let command = '';
|
let command = '';
|
||||||
let params = '';
|
let params = '';
|
||||||
// try to figure out where parameter starts
|
let fullcommand = line.substring(parsedhead[12].from + offset, parsedhead[12].to + offset2).trim();
|
||||||
let firstParamPos = fullcommand.indexOf(' -');
|
if (fullcommand.substr(fullcommand.length - 1) === ']') { fullcommand = fullcommand.slice(0, -1); }
|
||||||
let firstParamPathPos = fullcommand.indexOf(' /');
|
if (fullcommand.substr(0, 1) === '[') { command = fullcommand.substring(1); }
|
||||||
firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000);
|
else {
|
||||||
firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000);
|
// try to figure out where parameter starts
|
||||||
const firstPos = Math.min(firstParamPos, firstParamPathPos);
|
let firstParamPos = fullcommand.indexOf(' -');
|
||||||
let tmpCommand = fullcommand.substr(0, firstPos);
|
let firstParamPathPos = fullcommand.indexOf(' /');
|
||||||
const tmpParams = fullcommand.substr(firstPos);
|
firstParamPos = (firstParamPos >= 0 ? firstParamPos : 10000);
|
||||||
const lastSlashPos = tmpCommand.lastIndexOf('/');
|
firstParamPathPos = (firstParamPathPos >= 0 ? firstParamPathPos : 10000);
|
||||||
if (lastSlashPos >= 0) {
|
const firstPos = Math.min(firstParamPos, firstParamPathPos);
|
||||||
cmdPath = tmpCommand.substr(0, lastSlashPos);
|
let tmpCommand = fullcommand.substr(0, firstPos);
|
||||||
tmpCommand = tmpCommand.substr(lastSlashPos + 1);
|
const tmpParams = fullcommand.substr(firstPos);
|
||||||
}
|
const lastSlashPos = tmpCommand.lastIndexOf('/');
|
||||||
|
if (lastSlashPos >= 0) {
|
||||||
|
cmdPath = tmpCommand.substr(0, lastSlashPos);
|
||||||
|
tmpCommand = tmpCommand.substr(lastSlashPos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
if (firstPos === 10000 && tmpCommand.indexOf(' ') > -1) {
|
if (firstPos === 10000 && tmpCommand.indexOf(' ') > -1) {
|
||||||
const parts = tmpCommand.split(' ');
|
const parts = tmpCommand.split(' ');
|
||||||
if (fs.existsSync(path.join(cmdPath, parts[0]))) {
|
if (fs.existsSync(path.join(cmdPath, parts[0]))) {
|
||||||
command = parts.shift();
|
command = parts.shift();
|
||||||
params = (parts.join(' ') + ' ' + tmpParams).trim();
|
params = (parts.join(' ') + ' ' + tmpParams).trim();
|
||||||
|
} else {
|
||||||
|
command = tmpCommand.trim();
|
||||||
|
params = tmpParams.trim();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
command = tmpCommand.trim();
|
command = tmpCommand.trim();
|
||||||
params = tmpParams.trim();
|
params = tmpParams.trim();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
command = tmpCommand.trim();
|
|
||||||
params = tmpParams.trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ({
|
return ({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user