diff options
author | maxbr <maxbr@mi.fu-berlin.de> | 2016-08-19 17:14:11 +0200 |
---|---|---|
committer | maxbr <maxbr@mi.fu-berlin.de> | 2016-08-19 17:14:11 +0200 |
commit | 54322038f766be460b676d60974886be5f04d8f3 (patch) | |
tree | 057842e44e8894efb72b7c3d1bf947a1034eea33 /tools/pharos-dashboard/templates | |
parent | 66eb4d851e63d20031502ec0c96aaabe34c6fd32 (diff) |
Add a resource utilization page
JIRA: RELENG-12
Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'tools/pharos-dashboard/templates')
-rw-r--r-- | tools/pharos-dashboard/templates/dashboard/resource_utilization.html | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/tools/pharos-dashboard/templates/dashboard/resource_utilization.html b/tools/pharos-dashboard/templates/dashboard/resource_utilization.html new file mode 100644 index 00000000..fb483d60 --- /dev/null +++ b/tools/pharos-dashboard/templates/dashboard/resource_utilization.html @@ -0,0 +1,86 @@ +{% extends "base.html" %} +{% load staticfiles %} + +{% block extrahead %} + <!-- Morris Charts CSS --> + <link href="{% static "bower_components/morrisjs/morris.css" %}" rel="stylesheet"> + +{% endblock extrahead %} + + +{% block content %} + <div class="row"> + {% for resource, utilization in pods %} + <div class="col-lg-3"> + <div class="panel panel-default"> + <div class="panel-heading"> + {{ resource.name }} + </div> + <div class="panel-body"> + <div class="flot-chart"> + <div class="flot-chart-content" id="{{ resource.slave.name }}"></div> + </div> + </div> + </div> + </div> + {% endfor %} + </div> + +{% endblock content %} + + +{% block extrajs %} + + <!-- Flot Charts JavaScript --> + <script src="{% static "bower_components/flot/excanvas.min.js" %}"></script> + <script src="{% static "bower_components/flot/jquery.flot.js" %}"></script> + <script src="{% static "bower_components/flot/jquery.flot.pie.js" %}"></script> + <script src="{% static "bower_components/flot/jquery.flot.resize.js" %}"></script> + <script src="{% static "bower_components/flot/jquery.flot.time.js" %}"></script> + <script src="{% static "bower_components/flot.tooltip/js/jquery.flot.tooltip.min.js" %}"></script> + + <script type="text/javascript"> + $(document).ready(function () { + {% for resource, utilization in pods %} + $(function () { + var data = [{ + label: "Offline", + data: {{ utilization.offline }}, + color: '#d9534f' + }, { + label: "Online", + data: {{ utilization.online }}, + color: '#5cb85c' + }, { + label: "Idle", + data: {{ utilization.idle }}, + color: '#5bc0de' + }]; + + var plotObj = $.plot($("#{{ resource.slave.name }}"), data, { + series: { + pie: { + show: true + } + }, + grid: { + hoverable: true + }, + tooltip: true, + tooltipOpts: { + content: "%p.0%, %s", // show percentages, rounding to 2 decimal places + shifts: { + x: 20, + y: 0 + }, + defaultTheme: false + } + }); + + }); + {% endfor %} + + }); + </script> + +{% endblock extrajs %}
\ No newline at end of file |