summaryrefslogtreecommitdiffstats
path: root/htdocs
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2013-12-25 19:30:41 +0100
committermanuel <manuel@mausz.at>2013-12-25 19:30:41 +0100
commitbdd42c323cafb4ac054ce902c77d4a39bfe5c425 (patch)
tree2b8dc37a60fa870a69f8123b1c189cccb2611dcf /htdocs
parentd70072c2f4c348ba2f6a562fa31e3245209cf21f (diff)
downloadwebiopi-bdd42c323cafb4ac054ce902c77d4a39bfe5c425.tar.gz
webiopi-bdd42c323cafb4ac054ce902c77d4a39bfe5c425.tar.bz2
webiopi-bdd42c323cafb4ac054ce902c77d4a39bfe5c425.zip
add icmp timeout support
Diffstat (limited to 'htdocs')
-rw-r--r--htdocs/webiopi.js9
1 files changed, 5 insertions, 4 deletions
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() {
1361 return this.name + ": Duration"; 1361 return this.name + ": Duration";
1362} 1362}
1363 1363
1364Duration.prototype.getMillimeter = function(callback) { 1364Duration.prototype.getMilliseconds = function(callback) {
1365 $.get(this.url + "/duration/ms", function(data) { 1365 $.get(this.url + "/duration/ms", function(data) {
1366 callback(this.name, data); 1366 callback(this.name, data);
1367 }); 1367 });
@@ -1376,11 +1376,12 @@ Duration.prototype.refreshUI = function() {
1376 element.append(element.header); 1376 element.append(element.header);
1377 } 1377 }
1378 1378
1379 this.getMillimeter(function(name, data){ 1379 this.getMilliseconds(function(name, data){
1380 if (element != undefined) { 1380 if (element != undefined) {
1381 element.header.text(dist + ": " + data + "ms"); 1381 var text = (data > 0) ? data + "ms" : "Timeout";
1382 element.header.text(dist + ": " + text);
1382 } 1383 }
1383 setTimeout(function(){dist.refreshUI()}, dist.refreshTime); 1384 setTimeout(function() { dist.refreshUI() }, dist.refreshTime);
1384 }); 1385 });
1385} 1386}
1386 1387