monitor module widget template
authorCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Fri, 8 Aug 2014 15:51:27 +0000 (17:51 +0200)
committerJordan Augé <jordan.auge@lip6.fr>
Thu, 14 Aug 2014 13:37:12 +0000 (15:37 +0200)
portal/static/icons/ko.png [new file with mode: 0644]
portal/static/icons/ok.png [new file with mode: 0644]
portal/templates/_widget-monitor.html [new file with mode: 0644]

diff --git a/portal/static/icons/ko.png b/portal/static/icons/ko.png
new file mode 100644 (file)
index 0000000..0a39312
Binary files /dev/null and b/portal/static/icons/ko.png differ
diff --git a/portal/static/icons/ok.png b/portal/static/icons/ok.png
new file mode 100644 (file)
index 0000000..becd464
Binary files /dev/null and b/portal/static/icons/ok.png differ
diff --git a/portal/templates/_widget-monitor.html b/portal/templates/_widget-monitor.html
new file mode 100644 (file)
index 0000000..93dea37
--- /dev/null
@@ -0,0 +1,30 @@
+<div class="monitor">
+<div class="container">
+    <div class="row">
+        <div class="col-md-12">
+               <h1>Services Status</h1>
+        </div>
+    </div>
+       <div class="row" id="monitor-services">
+       </div>
+</div>
+</div>
+<script>
+       $(document).ready(function() {
+               $.get('/monitor/services', function(result) {
+                       console.log(result);
+                       for (var r in result) {
+                               html = '<div class="col-xs-6 col-sm-4 col-md-3 s-monitor"><div class="row">';
+                               html += '<div class="col-md-2"><img src="{{ STATIC_URL }}icons/'+result[r].status+'.png"></div>';
+                               html += '<div class="col-md-8">';
+                               html += '<h4>'+result[r].name+'<h4>';
+                               html += '<span class="subtitle">'+result[r].type+'</span>';
+                               if (typeof(result[r].version) != 'undefined')
+                                       html += ' <span class="version">version '+result[r].version+'</span>';
+                               html += '</div></div></div>';
+                               $('div#monitor-services').append(html);
+                       }
+               });
+       });
+</script>