From: Philipp Klaus Date: Thu, 14 Sep 2017 07:53:16 +0000 (+0200) Subject: DASH: implemented heartbeat for gviews X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5c144571424fedbc2618ea47612ce4bf76344972;p=mvd_epics.git DASH: implemented heartbeat for gviews --- diff --git a/python_suite/dashboard/static/css/style.css b/python_suite/dashboard/static/css/style.css index e4f320b..9e5c294 100644 --- a/python_suite/dashboard/static/css/style.css +++ b/python_suite/dashboard/static/css/style.css @@ -182,3 +182,13 @@ div.error { content: attr(data-checked); background-color: #0099CC; } + +#heartbeat.inactive { + background-color: #666; +} +#heartbeat.ok { + background-color: #0d2; +} +#heartbeat.warning { + background-color: #f44; +} diff --git a/python_suite/dashboard/static/js/gview.js b/python_suite/dashboard/static/js/gview.js index b8dd834..fdad8c4 100644 --- a/python_suite/dashboard/static/js/gview.js +++ b/python_suite/dashboard/static/js/gview.js @@ -3,6 +3,8 @@ function updateStatus() { .fail(function( jqxhr, textStatus, error ) { var err = textStatus + ", " + error; console.log( "Request Failed: " + err ); + $('#heartbeat').attr('class', 'warning') + $('#heartbeat .cover').fadeTo(200, 1.0, function() { $(this).fadeTo(200, 0.0); }); }) .done(function( data ) { var gview = document.getElementById("gview"); @@ -25,5 +27,7 @@ function updateStatus() { else if (pvField == "EGU") el.textContent = pv.unit; }); + $('#heartbeat').attr('class', 'ok') + $('#heartbeat .cover').fadeTo(200, 1.0, function() { $(this).fadeTo(200, 0.0); }); }); }; diff --git a/python_suite/dashboard/views/gview.jinja2 b/python_suite/dashboard/views/gview.jinja2 index 6502e17..9b7e806 100644 --- a/python_suite/dashboard/views/gview.jinja2 +++ b/python_suite/dashboard/views/gview.jinja2 @@ -8,6 +8,10 @@ {% endblock %} {% block content %} +
+
+
+
Your browser doesn't support SVG