networkConnections() refactored PID parsing (macOS)
This commit is contained in:
parent
93ccfdf3db
commit
1dd534d4cd
@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||||
|
| 5.23.16 | 2024-12-13 | `networkConnections()` refactored PID parsing (macOS) |
|
||||||
| 5.23.15 | 2024-12-21 | `users()`, `wifiNetworks()` fixed parsing (macOS Seguoia) |
|
| 5.23.15 | 2024-12-21 | `users()`, `wifiNetworks()` fixed parsing (macOS Seguoia) |
|
||||||
| 5.23.14 | 2024-12-18 | `chassis()` new chassis detection (macOS) |
|
| 5.23.14 | 2024-12-18 | `chassis()` new chassis detection (macOS) |
|
||||||
| 5.23.13 | 2024-12-14 | `wifiConnections()` improved BSSID parsing (windows) |
|
| 5.23.13 | 2024-12-14 | `wifiConnections()` improved BSSID parsing (windows) |
|
||||||
|
|||||||
@ -57,6 +57,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.23.16</th>
|
||||||
|
<td>2024-12-22</td>
|
||||||
|
<td><span class="code">networkConnections()</span> refactored PID parsing (macOS)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.23.15</th>
|
<th scope="row">5.23.15</th>
|
||||||
<td>2024-12-21</td>
|
<td>2024-12-21</td>
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
<img class="logo" src="assets/logo.png" alt="logo">
|
<img class="logo" src="assets/logo.png" alt="logo">
|
||||||
<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.23.15</span></div>
|
<div class="version">New Version: <span id="version">5.23.16</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">
|
||||||
|
|||||||
@ -1417,9 +1417,10 @@ function getProcessName(processes, pid) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
cmd = cmd.split(' -')[0];
|
cmd = cmd.split(' -')[0];
|
||||||
// return cmd;
|
cmd = cmd.split(' /')[0];
|
||||||
const cmdParts = cmd.split('/');
|
return cmd;
|
||||||
return cmdParts[cmdParts.length - 1];
|
// const cmdParts = cmd.split('/');
|
||||||
|
// return cmdParts[cmdParts.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
function networkConnections(callback) {
|
function networkConnections(callback) {
|
||||||
@ -1546,7 +1547,7 @@ function networkConnections(callback) {
|
|||||||
|
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
line = line.replace(/ +/g, ' ').split(' ');
|
line = line.replace(/ +/g, ' ').split(' ');
|
||||||
const hasTransferred = line.length >= 19;
|
const hasTransferred = line.length >= 17;
|
||||||
if (line.length >= 8) {
|
if (line.length >= 8) {
|
||||||
let localip = line[3];
|
let localip = line[3];
|
||||||
let localport = '';
|
let localport = '';
|
||||||
@ -1566,7 +1567,7 @@ function networkConnections(callback) {
|
|||||||
}
|
}
|
||||||
const hasState = states.indexOf(line[5]) >= 0;
|
const hasState = states.indexOf(line[5]) >= 0;
|
||||||
let connstate = hasState ? line[5] : 'UNKNOWN';
|
let connstate = hasState ? line[5] : 'UNKNOWN';
|
||||||
let pid = parseInt(line[8 + (hasState ? 0 : -1) + (hasTransferred ? 2 : 0)], 10);
|
let pid = parseInt(line[6 + (hasState ? 0 : -1) + (hasTransferred ? 2 : 0)], 10);
|
||||||
if (connstate) {
|
if (connstate) {
|
||||||
result.push({
|
result.push({
|
||||||
protocol: line[0],
|
protocol: line[0],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user