From bdd42c323cafb4ac054ce902c77d4a39bfe5c425 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 25 Dec 2013 19:30:41 +0100 Subject: add icmp timeout support --- htdocs/webiopi.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'htdocs/webiopi.js') diff --git a/htdocs/webiopi.js b/htdocs/webiopi.js index 04029d7..f893618 100644 --- a/htdocs/webiopi.js +++ b/htdocs/webiopi.js @@ -1361,7 +1361,7 @@ Duration.prototype.toString = function() { return this.name + ": Duration"; } -Duration.prototype.getMillimeter = function(callback) { +Duration.prototype.getMilliseconds = function(callback) { $.get(this.url + "/duration/ms", function(data) { callback(this.name, data); }); @@ -1376,11 +1376,12 @@ Duration.prototype.refreshUI = function() { element.append(element.header); } - this.getMillimeter(function(name, data){ + this.getMilliseconds(function(name, data){ if (element != undefined) { - element.header.text(dist + ": " + data + "ms"); + var text = (data > 0) ? data + "ms" : "Timeout"; + element.header.text(dist + ": " + text); } - setTimeout(function(){dist.refreshUI()}, dist.refreshTime); + setTimeout(function() { dist.refreshUI() }, dist.refreshTime); }); } -- cgit v1.2.3