networkInterfaces() fix uppercase iface names (linux)
This commit is contained in:
parent
06e47beec4
commit
505d3277c1
@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||||
|
| 5.30.5 | 2026-01-16 | `networkInterfaces()` fix uppercase iface names (linux) |
|
||||||
| 5.30.4 | 2026-01-15 | `powerShell()` fix UTF8 output (windows) |
|
| 5.30.4 | 2026-01-15 | `powerShell()` fix UTF8 output (windows) |
|
||||||
| 5.30.3 | 2026-01-11 | Updated docs, code cleanup |
|
| 5.30.3 | 2026-01-11 | Updated docs, code cleanup |
|
||||||
| 5.30.2 | 2026-01-08 | `processes()` revert added user (windows) |
|
| 5.30.2 | 2026-01-08 | `processes()` revert added user (windows) |
|
||||||
|
|||||||
@ -57,6 +57,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.30.5
|
||||||
|
</th>
|
||||||
|
<td>2026-01-16</td>
|
||||||
|
<td><span class="code">networkInterfaces()</span> fix uppercase support (linux)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.30.4
|
<th scope="row">5.30.4
|
||||||
</th>
|
</th>
|
||||||
|
|||||||
@ -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.30.4</span></div>
|
<div class="version">New Version: <span id="version">5.30.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">
|
||||||
@ -212,7 +212,7 @@
|
|||||||
<div class="title">Downloads last month</div>
|
<div class="title">Downloads last month</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||||
<div class="numbers">940</div>
|
<div class="numbers">941</div>
|
||||||
<div class="title">Dependents</div>
|
<div class="title">Dependents</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -281,7 +281,7 @@ function getWindowsNics() {
|
|||||||
function getWindowsDNSsuffixes() {
|
function getWindowsDNSsuffixes() {
|
||||||
let iface = {};
|
let iface = {};
|
||||||
|
|
||||||
let dnsSuffixes = {
|
const dnsSuffixes = {
|
||||||
primaryDNS: '',
|
primaryDNS: '',
|
||||||
exitCode: 0,
|
exitCode: 0,
|
||||||
ifaces: []
|
ifaces: []
|
||||||
@ -374,7 +374,7 @@ function getWindowsWirelessIfaceSSID(interfaceName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
||||||
let i8021x = {
|
const i8021x = {
|
||||||
state: 'Unknown',
|
state: 'Unknown',
|
||||||
protocol: 'Unknown'
|
protocol: 'Unknown'
|
||||||
};
|
};
|
||||||
@ -947,7 +947,7 @@ function networkInterfaces(callback, rescan, defaultString) {
|
|||||||
ip6 = ip6link;
|
ip6 = ip6link;
|
||||||
ip6subnet = ip6linksubnet;
|
ip6subnet = ip6linksubnet;
|
||||||
}
|
}
|
||||||
const iface = dev.split(':')[0].trim().toLowerCase();
|
const iface = dev.split(':')[0].trim();
|
||||||
let ifaceSanitized = '';
|
let ifaceSanitized = '';
|
||||||
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
|
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
|
||||||
const l = util.mathMin(s.length, 2000);
|
const l = util.mathMin(s.length, 2000);
|
||||||
@ -1290,7 +1290,7 @@ function networkStats(ifaces, callback) {
|
|||||||
Object.setPrototypeOf(ifaces, util.stringObj);
|
Object.setPrototypeOf(ifaces, util.stringObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
ifaces = ifaces.trim().toLowerCase().replace(/,+/g, '|');
|
ifaces = ifaces.trim().replace(/,+/g, '|');
|
||||||
ifacesArray = ifaces.split('|');
|
ifacesArray = ifaces.split('|');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1334,11 +1334,11 @@ function networkStats(ifaces, callback) {
|
|||||||
|
|
||||||
function networkStatsSingle(iface) {
|
function networkStatsSingle(iface) {
|
||||||
function parseLinesWindowsPerfData(sections) {
|
function parseLinesWindowsPerfData(sections) {
|
||||||
let perfData = [];
|
const perfData = [];
|
||||||
for (let i in sections) {
|
for (let i in sections) {
|
||||||
if ({}.hasOwnProperty.call(sections, i)) {
|
if ({}.hasOwnProperty.call(sections, i)) {
|
||||||
if (sections[i].trim() !== '') {
|
if (sections[i].trim() !== '') {
|
||||||
let lines = sections[i].trim().split('\r\n');
|
const lines = sections[i].trim().split('\r\n');
|
||||||
perfData.push({
|
perfData.push({
|
||||||
name: util
|
name: util
|
||||||
.getValue(lines, 'Name', ':')
|
.getValue(lines, 'Name', ':')
|
||||||
@ -1595,7 +1595,7 @@ function getProcessName(processes, pid) {
|
|||||||
function networkConnections(callback) {
|
function networkConnections(callback) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let result = [];
|
const result = [];
|
||||||
if (_linux || _freebsd || _openbsd || _netbsd) {
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
||||||
let cmd =
|
let cmd =
|
||||||
'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
|
'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';
|
||||||
@ -1689,13 +1689,6 @@ function networkConnections(callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (line.length >= 7 && line[6].indexOf('users:') > -1) {
|
|
||||||
// const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(',');
|
|
||||||
// if (proc.length > 2) {
|
|
||||||
// process = proc[0].split(' ')[0].split(':')[0];
|
|
||||||
// pid = parseInt(proc[1], 10);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
if (connstate) {
|
if (connstate) {
|
||||||
result.push({
|
result.push({
|
||||||
protocol: line[0],
|
protocol: line[0],
|
||||||
@ -1806,7 +1799,7 @@ function networkConnections(callback) {
|
|||||||
if (line.length >= 4) {
|
if (line.length >= 4) {
|
||||||
let localip = line[1];
|
let localip = line[1];
|
||||||
let localport = '';
|
let localport = '';
|
||||||
let localaddress = line[1].split(':');
|
const localaddress = line[1].split(':');
|
||||||
if (localaddress.length > 1) {
|
if (localaddress.length > 1) {
|
||||||
localport = localaddress[localaddress.length - 1];
|
localport = localaddress[localaddress.length - 1];
|
||||||
localaddress.pop();
|
localaddress.pop();
|
||||||
@ -1815,14 +1808,14 @@ function networkConnections(callback) {
|
|||||||
localip = localip.replace(/\[/g, '').replace(/\]/g, '');
|
localip = localip.replace(/\[/g, '').replace(/\]/g, '');
|
||||||
let peerip = line[2];
|
let peerip = line[2];
|
||||||
let peerport = '';
|
let peerport = '';
|
||||||
let peeraddress = line[2].split(':');
|
const peeraddress = line[2].split(':');
|
||||||
if (peeraddress.length > 1) {
|
if (peeraddress.length > 1) {
|
||||||
peerport = peeraddress[peeraddress.length - 1];
|
peerport = peeraddress[peeraddress.length - 1];
|
||||||
peeraddress.pop();
|
peeraddress.pop();
|
||||||
peerip = peeraddress.join(':');
|
peerip = peeraddress.join(':');
|
||||||
}
|
}
|
||||||
peerip = peerip.replace(/\[/g, '').replace(/\]/g, '');
|
peerip = peerip.replace(/\[/g, '').replace(/\]/g, '');
|
||||||
let pid = util.toInt(line[4]);
|
const pid = util.toInt(line[4]);
|
||||||
let connstate = line[3];
|
let connstate = line[3];
|
||||||
if (connstate === 'HERGESTELLT') {
|
if (connstate === 'HERGESTELLT') {
|
||||||
connstate = 'ESTABLISHED';
|
connstate = 'ESTABLISHED';
|
||||||
@ -1901,7 +1894,7 @@ function networkGatewayDefault(callback) {
|
|||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let result = '';
|
let result = '';
|
||||||
if (_linux || _freebsd || _openbsd || _netbsd) {
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
||||||
let cmd = 'ip route get 1';
|
const cmd = 'ip route get 1';
|
||||||
try {
|
try {
|
||||||
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
|
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user