1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Added graph scale for instance

This commit is contained in:
Retspen 2015-03-20 12:06:32 +02:00
parent 02570cd826
commit 4a17f08740
5 changed files with 302 additions and 16 deletions

View file

@ -81,7 +81,7 @@
</div>
{% endblock %}
{% block script %}
<script src="{{ STATIC_URL }}/js/Chart.min.js"></script>
<script src="{{ STATIC_URL }}js/Chart.min.js"></script>
<script>
var cpuLineData = {
labels : [0, 0, 0, 0, 0],
@ -133,7 +133,7 @@
responsive: true
});
function hostusage() {
function graph_usage() {
$.getJSON('{% url 'compute_graph' compute_id %}', function (data) {
cpuChart.scale.xLabels = data.timeline;
memChart.scale.xLabels = data.timeline;
@ -145,8 +145,9 @@
memChart.update();
});
}
$(function () {
window.setInterval('hostusage()', 4000);
window.setInterval(graph_usage(), 4000);
});
</script>
{% endblock %}