networkStats() fixed comparison issue windows

This commit is contained in:
Sebastian Hildebrandt
2020-06-06 16:04:18 +02:00
parent 13b01658ec
commit 0f95d40164
4 changed files with 10 additions and 4 deletions
+3 -3
View File
@@ -1019,7 +1019,7 @@ function networkStatsSingle(iface) {
if (sections[i].trim() !== '') {
let lines = sections[i].trim().split('\r\n');
perfData.push({
name: util.getValue(lines, 'Name', '=').replace(/[()\[\] ]+/g, '').toLowerCase(),
name: util.getValue(lines, 'Name', '=').replace(/[()\[\] ]+/g, '').replace('#', '_').toLowerCase(),
rx_bytes: parseInt(util.getValue(lines, 'BytesReceivedPersec', '='), 10),
rx_errors: parseInt(util.getValue(lines, 'PacketsReceivedErrors', '='), 10),
rx_dropped: parseInt(util.getValue(lines, 'PacketsReceivedDiscarded', '='), 10),
@@ -1165,8 +1165,8 @@ function networkStatsSingle(iface) {
det.mac.toLowerCase() === ifaceSanitized.toLowerCase() ||
det.ip4.toLowerCase() === ifaceSanitized.toLowerCase() ||
det.ip6.toLowerCase() === ifaceSanitized.toLowerCase() ||
det.ifaceName.replace(/[()\[\] ]+/g, '').toLowerCase() === ifaceSanitized.replace(/[()\[\] ]+/g, '').toLowerCase()) &&
(det.ifaceName.replace(/[()\[\] ]+/g, '').toLowerCase() === detail.name)) {
det.ifaceName.replace(/[()\[\] ]+/g, '').replace('#', '_').toLowerCase() === ifaceSanitized.replace(/[()\[\] ]+/g, '').replace('#', '_').toLowerCase()) &&
(det.ifaceName.replace(/[()\[\] ]+/g, '').replace('#', '_').toLowerCase() === detail.name)) {
ifaceName = det.iface;
rx_bytes = detail.rx_bytes;
rx_dropped = detail.rx_dropped;