From a32858989e98159eff2e678d04cb7d1d4d7bf37c Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 11 Jun 2019 16:26:52 +0200 Subject: [PATCH] networkStats() bug fix windows --- CHANGELOG.md | 1 + docs/history.html | 5 +++++ docs/index.html | 4 ++-- lib/network.js | 7 ++++++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35dac55..932cb9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.9.1 | 2019-06-11 | `networkStats()` bug fix windows | | 4.9.0 | 2019-06-03 | `graphics()` added vendor, refresh rate, current res | | 4.8.4 | 2019-06-03 | `vboxInfo()` fixed call parameters | | 4.8.3 | 2019-06-01 | `vboxInfo()` added stoppedSince, started, stopped | diff --git a/docs/history.html b/docs/history.html index 76e9119..6fc69f9 100644 --- a/docs/history.html +++ b/docs/history.html @@ -80,6 +80,11 @@ + + 4.9.0 + 2019-06-03 + networkStats() bugfix windows + 4.9.0 2019-06-03 diff --git a/docs/index.html b/docs/index.html index 71976d9..3d1946d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -168,7 +168,7 @@
systeminformation
-
Current Version: 4.9.0
+
Current Version: 4.9.1
@@ -199,7 +199,7 @@
Downloads last month
-
160
+
161
Dependends
diff --git a/lib/network.js b/lib/network.js index c19bf93..54a96c7 100644 --- a/lib/network.js +++ b/lib/network.js @@ -665,7 +665,12 @@ function networkStatsSingle(iface) { tx_bytes = 0; perfData.forEach(detail => { interfaces.forEach(det => { - if ((det.iface.toLowerCase() === iface.toLowerCase() || det.mac.toLowerCase() === iface.toLowerCase() || det.ip4.toLowerCase() === iface.toLowerCase() || det.ip6.toLowerCase() === iface.toLowerCase() || det.ifaceName.replace(/[()\[\] ]+/g, '').toLowerCase() === iface.replace(/[()\[\] ]+/g, '').toLowerCase()) && det.ifaceName.replace(/[()\[\] ]+/g, '').toLowerCase() === detail.name) { + if ((det.iface.toLowerCase() === iface.toLowerCase() || + det.mac.toLowerCase() === iface.toLowerCase() || + det.ip4.toLowerCase() === iface.toLowerCase() || + det.ip6.toLowerCase() === iface.toLowerCase() || + (det.ifaceName.replace(/[()\[\] ]+/g, '').toLowerCase() === iface.replace(/[()\[\] ]+/g, '').toLowerCase()) && + det.ifaceName.replace(/[()\[\] ]+/g, '').toLowerCase() === detail.name)) { ifaceName = det.iface; rx_bytes = detail.rx_bytes; rx_dropped = detail.rx_dropped;