From: Loic Baron Date: Wed, 8 Apr 2015 14:46:47 +0000 (+0200) Subject: Monitoring Widget: no monitoring available if error in request X-Git-Tag: myslice-1.3~41 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7ab4b86ad8c61b3e7119e2d54bd5cfa14dcc92f7;hp=0c1fab0628c9bad44ed5e3416662bb8f0c7c803b;p=unfold.git Monitoring Widget: no monitoring available if error in request --- diff --git a/portal/templates/_widget-monitor.html b/portal/templates/_widget-monitor.html index cb7af4fc..6a7ab7a7 100644 --- a/portal/templates/_widget-monitor.html +++ b/portal/templates/_widget-monitor.html @@ -14,14 +14,18 @@ $(document).ready(function() { $.get('/monitor/services', function(result) { for (var r in result) { - html = '
'; - html += '
'; - html += '
'; - html += '

'+result[r].name+'

'; - html += ''+result[r].type+''; - if (typeof(result[r].version) != 'undefined') - html += ' version '+result[r].version+''; - html += '

'; + if(r == 'error'){ + html = '
no monitoring available
' + }else{ + html = '
'; + html += '
'; + html += '
'; + html += '

'+result[r].name+'

'; + html += ''+result[r].type+''; + if (typeof(result[r].version) != 'undefined') + html += ' version '+result[r].version+''; + html += '

'; + } $('div#monitor-services').append(html); } });