mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
Change timers for ajax
This commit is contained in:
parent
a2d1314a75
commit
a4fffee182
3 changed files with 14 additions and 7 deletions
|
@ -1000,7 +1000,17 @@
|
||||||
netChart[data.netdata[j].dev].update();
|
netChart[data.netdata[j].dev].update();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 6000);
|
}, 10000);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
window.setInterval(function get_status() {
|
||||||
|
var status = {{ status }};
|
||||||
|
$.getJSON('{% url 'inst_status' compute_id vname %}', function (data) {
|
||||||
|
if (data['status'] != status) {
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 2000);
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -133,7 +133,7 @@
|
||||||
responsive: true
|
responsive: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function graph_usage() {
|
window.setInterval(function graph_usage() {
|
||||||
$.getJSON('{% url 'compute_graph' compute_id %}', function (data) {
|
$.getJSON('{% url 'compute_graph' compute_id %}', function (data) {
|
||||||
cpuChart.scale.xLabels = data.timeline;
|
cpuChart.scale.xLabels = data.timeline;
|
||||||
memChart.scale.xLabels = data.timeline;
|
memChart.scale.xLabels = data.timeline;
|
||||||
|
@ -144,10 +144,6 @@
|
||||||
cpuChart.update();
|
cpuChart.update();
|
||||||
memChart.update();
|
memChart.update();
|
||||||
});
|
});
|
||||||
}
|
}, 5000);
|
||||||
|
|
||||||
$(function () {
|
|
||||||
window.setInterval(graph_usage(), 4000);
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -13,6 +13,7 @@ urlpatterns = patterns('',
|
||||||
url(r'^instance/(\d+)/([\w\-\.]+)/$', 'instances.views.instance', name='instance'),
|
url(r'^instance/(\d+)/([\w\-\.]+)/$', 'instances.views.instance', name='instance'),
|
||||||
|
|
||||||
url(r'^instance/statistics/(\d+)/([\w\-\.]+)/$', 'instances.views.inst_graph', name='inst_graph'),
|
url(r'^instance/statistics/(\d+)/([\w\-\.]+)/$', 'instances.views.inst_graph', name='inst_graph'),
|
||||||
|
url(r'^instance/status/(\d+)/([\w\-\.]+)/$', 'instances.views.inst_status', name='inst_status'),
|
||||||
|
|
||||||
url(r'^computes/$', 'computes.views.computes', name='computes'),
|
url(r'^computes/$', 'computes.views.computes', name='computes'),
|
||||||
url(r'^compute/overview/(\d+)/$', 'computes.views.overview', name='overview'),
|
url(r'^compute/overview/(\d+)/$', 'computes.views.overview', name='overview'),
|
||||||
|
|
Loading…
Reference in a new issue