From 7ab4b86ad8c61b3e7119e2d54bd5cfa14dcc92f7 Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Wed, 8 Apr 2015 16:46:47 +0200 Subject: [PATCH] Monitoring Widget: no monitoring available if error in request --- portal/templates/_widget-monitor.html | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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); } }); -- 2.43.0