| 4.24.1 |
2020-05-03 |
diff --git a/docs/index.html b/docs/index.html
index b904529..f1323ad 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -168,7 +168,7 @@
systeminformation
- Current Version: 4.24.1
+ Current Version: 4.24.2
diff --git a/lib/cpu.js b/lib/cpu.js
index c532c57..4507a4a 100644
--- a/lib/cpu.js
+++ b/lib/cpu.js
@@ -506,12 +506,12 @@ function getCpu() {
let modelline = '';
let lines = [];
if (os.cpus()[0] && os.cpus()[0].model) modelline = os.cpus()[0].model;
- exec('export LC_ALL=C; dmidecode -t 4 2>/dev/null; dmidecode -t 7 2>/dev/null; unset LC_ALL', function (error, stdout) {
+ exec('export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL', function (error, stdout) {
let cache = [];
if (!error) {
const data = stdout.toString().split('# dmidecode');
- const processor = data.length > 0 ? data[1] : '';
- cache = data.length > 1 ? data[2].split('Cache Information') : [];
+ const processor = data.length > 1 ? data[1] : '';
+ cache = data.length > 2 ? data[2].split('Cache Information') : [];
lines = processor.split('\n');
}
@@ -767,7 +767,7 @@ function cpuTemperature(callback) {
for (let i = 0; i < temps.length; i++) {
if (temps[i] && (labels[i] === undefined || (labels[i] && labels[i].toLowerCase().startsWith('core')))) {
result.cores.push(Math.round(parseInt(temps[i], 10) / 100) / 10);
- } else if (temps[i] && labels[i] && result.main === -1) {
+ } else if (temps[i] && labels[i] && result.main === -1) {
result.main = Math.round(parseInt(temps[i], 10) / 100) / 10;
}
}
diff --git a/lib/network.js b/lib/network.js
index 342639b..d379d41 100644
--- a/lib/network.js
+++ b/lib/network.js
@@ -1081,11 +1081,11 @@ function networkStatsSingle(iface) {
const line = lines[i].replace(/ +/g, ' ').split(' ');
if (line && line[0] && line[7] && line[10]) {
rx_bytes = rx_bytes + parseInt(line[7]);
- if (stats[6].trim() !== '-') { rx_dropped = rx_dropped + parseInt(stats[6]); }
- if (stats[5].trim() !== '-') { rx_errors = rx_errors + parseInt(stats[5]); }
+ if (line[6].trim() !== '-') { rx_dropped = rx_dropped + parseInt(line[6]); }
+ if (line[5].trim() !== '-') { rx_errors = rx_errors + parseInt(line[5]); }
tx_bytes = tx_bytes + parseInt(line[10]);
- if (stats[12].trim() !== '-') { tx_dropped = tx_dropped + parseInt(stats[12]); }
- if (stats[9].trim() !== '-') { tx_errors = tx_errors + parseInt(stats[9]); }
+ if (line[12].trim() !== '-') { tx_dropped = tx_dropped + parseInt(line[12]); }
+ if (line[9].trim() !== '-') { tx_errors = tx_errors + parseInt(line[9]); }
operstate = 'up';
}
}
diff --git a/tslint.json b/tslint.json
new file mode 100644
index 0000000..6783f80
--- /dev/null
+++ b/tslint.json
@@ -0,0 +1,51 @@
+{
+ "defaultSeverity": "error",
+ "extends": [
+ "tslint:recommended"
+ ],
+ "jsRules": {},
+ "rules": {
+ "no-trailing-whitespace": false,
+ "quotemark": [
+ false
+ ],
+ "comment-format": [
+ false
+ ],
+ "member-access": false,
+ "whitespace": [
+ true
+ ],
+ "object-literal-shorthand": false,
+ "ordered-imports": [
+ false
+ ],
+ "one-line": [
+ false
+ ],
+ "max-line-length": [
+ true,
+ 140
+ ],
+ "only-arrow-functions": [
+ false
+ ],
+ "object-literal-sort-keys": [
+ false
+ ],
+ "array-type": [
+ false
+ ],
+ "variable-name": [
+ false
+ ],
+ "interface-name": [
+ false
+ ],
+ "one-variable-per-declaration": [
+ false
+ ],
+ "no-console": false
+ },
+ "rulesDirectory": []
+}