From: Scott Baker Date: Tue, 27 Jan 2015 23:29:41 +0000 (-0800) Subject: red and green observer status icons X-Git-Url: http://git.onelab.eu/?p=plstackapi.git;a=commitdiff_plain;h=16e999bf8ad91595a563a75049db8040d6d85e71 red and green observer status icons --- diff --git a/planetstack/core/static/img/green-cloud.gif b/planetstack/core/static/img/green-cloud.gif new file mode 100644 index 0000000..0a80d7d Binary files /dev/null and b/planetstack/core/static/img/green-cloud.gif differ diff --git a/planetstack/core/static/img/red-cloud.gif b/planetstack/core/static/img/red-cloud.gif new file mode 100644 index 0000000..3025720 Binary files /dev/null and b/planetstack/core/static/img/red-cloud.gif differ diff --git a/planetstack/core/static/observer_status.js b/planetstack/core/static/observer_status.js new file mode 100644 index 0000000..56e9f09 --- /dev/null +++ b/planetstack/core/static/observer_status.js @@ -0,0 +1,25 @@ +function updateObserverStatus() { + var url="/observer"; + console.log("fetching observer status url " + url); + $.ajax({ url: url, + dataType : 'json', + type : 'GET', + success: function(newData) { + console.log(newData); + if (newData.health==":-)") { + html = ''; + } else { + html = ''; + } + $("#observer-status").html(html); + setTimeout(function() { updateObserverStatus(); }, 60000); + }, + error: function() { + setTimeout(function() { updateObserverStatus(); }, 60000); + } +}); +} + +$( document ).ready(function() { + updateObserverStatus(); +}); diff --git a/planetstack/templates/admin/base.html b/planetstack/templates/admin/base.html index 49c6791..08d19d1 100644 --- a/planetstack/templates/admin/base.html +++ b/planetstack/templates/admin/base.html @@ -14,6 +14,7 @@ + {% if 'SHOW_REQUIRED_ASTERISK'|suit_conf %} @@ -84,6 +85,7 @@
{% trans 'Welcome,' %} {{user.email}} + {% block userlinks %} {% url 'django-admindocs-docroot' as docsroot %}