blob: 4ec77101e075b82c9a98f6adae07838fee73f146 [file] [log] [blame]
Scott Bakerac543a72015-01-27 15:29:41 -08001function updateObserverStatus() {
2 var url="/observer";
3 console.log("fetching observer status url " + url);
4 $.ajax({ url: url,
5 dataType : 'json',
6 type : 'GET',
7 success: function(newData) {
8 console.log(newData);
9 if (newData.health==":-)") {
10 html = '<span style="margin-left: 16px;" title="last observer run time = ' + Math.floor(newData.last_duration) + ' seconds"><img src="/static/img/green-cloud.gif" width=16 height=16></span>';
11 } else {
Scott Bakerb5c86972015-01-29 14:46:14 -080012 html = '<span style="margin-left: 16px;" title="observer is offline"><img src="/static/img/red-cloud.gif" width=16 height=16></span>';
Scott Bakerac543a72015-01-27 15:29:41 -080013 }
14 $("#observer-status").html(html);
15 setTimeout(function() { updateObserverStatus(); }, 60000);
16 },
17 error: function() {
18 setTimeout(function() { updateObserverStatus(); }, 60000);
19 }
20});
21}
22
23$( document ).ready(function() {
24 updateObserverStatus();
25});