inetLatency() Windows fix

This commit is contained in:
Sebastian Hildebrandt 2019-02-05 17:59:25 +01:00
parent 8df7d8a93a
commit ee338f786a
4 changed files with 8 additions and 2 deletions

View File

@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 4.0.7 | 2019-02-05 | `inetLatency()` latency Windows fix |
| 4.0.6 | 2019-02-04 | powershell catch error |
| 4.0.5 | 2019-02-03 | updated docs |
| 4.0.4 | 2019-02-03 | code cleanup, updated docs |

View File

@ -80,6 +80,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">4.0.7</th>
<td>2019-02-06</td>
<td><span class="code">inetLatency()</span> latency Windows fix</td>
</tr>
<tr>
<th scope="row">4.0.6</th>
<td>2019-02-04</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span></div>
<div class="version">Current Version: <span id="version">4.0.6</span></div>
<div class="version">Current Version: <span id="version">4.0.7</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>
</div>
<div class="down">

View File

@ -160,7 +160,7 @@ function inetLatency(host, callback) {
let lines = stdout.toString().split('\r\n');
lines.shift();
lines.forEach(function (line) {
if (line.toLowerCase().startsWith(' min')) {
if (line.toLowerCase().indexOf('ms,') > -1) {
let l = line.replace(/ +/g, ' ').split(' ');
if (l.length > 8) {
result = parseFloat(l[9]);