2018-04-18 16:46:53 -04:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
|
|
|
|
{% block content %}
|
2018-04-21 18:18:20 -04:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-12">
|
|
|
|
<figure>
|
|
|
|
<div id="history_graph">{{history_graph|safe}}</div>
|
2018-04-23 17:03:50 -04:00
|
|
|
<figcaption class="float-right">
|
2018-04-21 18:18:20 -04:00
|
|
|
<span id="history_graph_zoom_out" class="h4 oi oi-zoom-out text-muted" style="cursor:pointer;"></span>
|
|
|
|
<span id="history_graph_zoom_in" class="h4 oi oi-zoom-in text-muted" style="cursor:pointer;"></span>
|
|
|
|
</figcaption>
|
2018-04-23 17:03:50 -04:00
|
|
|
<figcaption class="float-left">
|
|
|
|
<span class="h4 text-muted">{{instance_count}} instances</span>
|
|
|
|
<span class="h4 text-muted">— {{client_count}} clients</span>
|
2018-05-21 17:09:27 -04:00
|
|
|
<span class="h4 text-muted">— {{server_count}} servers</span>
|
2018-04-23 17:03:50 -04:00
|
|
|
</figcaption>
|
2018-04-21 18:18:20 -04:00
|
|
|
</figure>
|
2018-04-24 18:01:27 -04:00
|
|
|
|
2018-04-23 17:03:50 -04:00
|
|
|
</div>
|
|
|
|
<div class="col-12">
|
2018-04-24 18:01:27 -04:00
|
|
|
|
2018-04-21 18:18:20 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block scripts %}
|
2018-04-24 18:01:27 -04:00
|
|
|
<script type="text/javascript" src="http://kozea.github.com/pygal.js/latest/pygal-tooltips.min.js"></script>
|
|
|
|
<script>
|
|
|
|
let dataPoints = {{data_points}};
|
2018-05-21 17:09:27 -04:00
|
|
|
let maxPoints = 2880;
|
2018-04-24 18:01:27 -04:00
|
|
|
maxPoints = Math.min(maxPoints, dataPoints);
|
|
|
|
let zoomLevel = Math.floor(maxPoints);
|
|
|
|
let performingZoom = false;
|
|
|
|
|
|
|
|
function updateHistoryGraph() {
|
|
|
|
perfomingZoom = true;
|
|
|
|
$.get('/history/' + zoomLevel)
|
|
|
|
.done(function (content) {
|
|
|
|
$('#history_graph').html(content.message);
|
2018-05-08 00:58:46 -04:00
|
|
|
//maxPoints = Math.min(maxPoints, dataPoints);
|
2018-04-24 18:01:27 -04:00
|
|
|
perfomingZoom = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//setInterval(updateHistoryGraph, 30000);
|
|
|
|
|
|
|
|
$('#history_graph_zoom_out').click(function () {
|
|
|
|
if (performingZoom === true) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
zoomLevel = Math.floor(zoomLevel * 2) <= maxPoints ? Math.floor(zoomLevel * 2) : maxPoints;
|
|
|
|
updateHistoryGraph();
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#history_graph_zoom_in').click(function () {
|
|
|
|
if (performingZoom === true) {
|
|
|
|
return false;
|
2018-04-21 18:18:20 -04:00
|
|
|
}
|
2018-04-24 18:01:27 -04:00
|
|
|
zoomLevel = zoomLevel / 2 > 2 ? Math.ceil(zoomLevel / 2) : 2;
|
|
|
|
updateHistoryGraph();
|
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
2018-04-18 16:46:53 -04:00
|
|
|
{% endblock %}
|