baseboard(), getDefaultNetworkInterface() fix catch error
This commit is contained in:
parent
a1beb0d4a8
commit
43e6c6480c
@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 5.8.2 | 2021-08-24 | `baseboard()`, `getDefaultNetworkInterface()` fix catch error |
|
||||||
| 5.8.1 | 2021-08-24 | `battery()` fix capacity |
|
| 5.8.1 | 2021-08-24 | `battery()` fix capacity |
|
||||||
| 5.8.0 | 2021-08-02 | `disksIO()` added waitTime, waitPercent (linux) |
|
| 5.8.0 | 2021-08-02 | `disksIO()` added waitTime, waitPercent (linux) |
|
||||||
| 5.7.14 | 2021-08-01 | `cpu()` cache calculation fix (linux) |
|
| 5.7.14 | 2021-08-01 | `cpu()` cache calculation fix (linux) |
|
||||||
|
|||||||
@ -56,6 +56,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.8.2</th>
|
||||||
|
<td>2021-08-24</td>
|
||||||
|
<td><span class="code">baseboard(), getDefaultNetworkInterface()</span> fix catch error</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.8.1</th>
|
<th scope="row">5.8.1</th>
|
||||||
<td>2021-08-24</td>
|
<td>2021-08-24</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.8.1</span></div>
|
<div class="version">New Version: <span id="version">5.8.2</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">
|
||||||
|
|||||||
@ -39,9 +39,10 @@ let pathToIp;
|
|||||||
|
|
||||||
function getDefaultNetworkInterface() {
|
function getDefaultNetworkInterface() {
|
||||||
|
|
||||||
let ifaces = os.networkInterfaces();
|
|
||||||
let ifacename = '';
|
let ifacename = '';
|
||||||
let ifacenameFirst = '';
|
let ifacenameFirst = '';
|
||||||
|
try {
|
||||||
|
let ifaces = os.networkInterfaces();
|
||||||
|
|
||||||
let scopeid = 9999;
|
let scopeid = 9999;
|
||||||
|
|
||||||
@ -61,7 +62,6 @@ function getDefaultNetworkInterface() {
|
|||||||
}
|
}
|
||||||
ifacename = ifacename || ifacenameFirst || '';
|
ifacename = ifacename || ifacenameFirst || '';
|
||||||
|
|
||||||
try {
|
|
||||||
if (_windows) {
|
if (_windows) {
|
||||||
// https://www.inetdaemon.com/tutorials/internet/ip/routing/default_route.shtml
|
// https://www.inetdaemon.com/tutorials/internet/ip/routing/default_route.shtml
|
||||||
let defaultIp = '';
|
let defaultIp = '';
|
||||||
|
|||||||
@ -615,7 +615,12 @@ function baseboard(callback) {
|
|||||||
result.memSlots = util.toInt(util.getValue(lines, 'Number Of Devices')) || null;
|
result.memSlots = util.toInt(util.getValue(lines, 'Number Of Devices')) || null;
|
||||||
|
|
||||||
// raspberry
|
// raspberry
|
||||||
const linesRpi = fs.readFileSync('/proc/cpuinfo').toString().split('\n');
|
let linesRpi = '';
|
||||||
|
try {
|
||||||
|
linesRpi = fs.readFileSync('/proc/cpuinfo').toString().split('\n');
|
||||||
|
} catch (e) {
|
||||||
|
util.noop();
|
||||||
|
}
|
||||||
const hardware = util.getValue(linesRpi, 'hardware');
|
const hardware = util.getValue(linesRpi, 'hardware');
|
||||||
if (hardware.startsWith('BCM')) {
|
if (hardware.startsWith('BCM')) {
|
||||||
const rpi = util.decodePiCpuinfo(linesRpi);
|
const rpi = util.decodePiCpuinfo(linesRpi);
|
||||||
|
|||||||
@ -112,7 +112,7 @@ function getValue(lines, property, separator, trimmed) {
|
|||||||
if (trimmed) {
|
if (trimmed) {
|
||||||
line = line.trim();
|
line = line.trim();
|
||||||
}
|
}
|
||||||
if (line.startsWith(property) && line.match(property + separator)) {
|
if (line.startsWith(property)) {
|
||||||
const parts = trimmed ? lines[i].trim().split(separator) : lines[i].split(separator);
|
const parts = trimmed ? lines[i].trim().split(separator) : lines[i].split(separator);
|
||||||
if (parts.length >= 2) {
|
if (parts.length >= 2) {
|
||||||
parts.shift();
|
parts.shift();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user