blob: 08712b7c56dfb8e916f0d941d1cbeb43e9b43f35 [file] [log] [blame]
Dirk Vogt62ff7f22017-05-04 16:07:21 +02001<div class="panel datatable" >
2 <h2>{{ title }}</h2>
3 <table id = "{{element_name}}" class="display table table-striped" ></table>
4 </div>
5<script>
6
7$(document).ready(function() {
8 console.log("Generating report table");
9 $.getJSON( "{% url 'hiccup_stats_api_v1_device_overview' uuid %}", function(json_response) {
10 dataSet = [];
11 dataSet.push(["UUID:", json_response.uuid]);
Dirk Vogt7439ee72017-12-05 15:51:17 +010012 dataSet.push(["Board Date:", new Date(json_response.board_date).toDateString()]);
13 dataSet.push(["Last Active:", new Date(json_response.last_active).toDateString()]);
Dirk Vogt62ff7f22017-05-04 16:07:21 +020014 dataSet.push(["HeartBeats sent:", json_response.heartbeats]);
15 dataSet.push(["Prob. Crashes:", json_response.crashreports]);
16 dataSet.push(["Prob. Crashes per Day:", json_response.crashes_per_day.toFixed(2)]);
17 dataSet.push(["SMPLs:", json_response.smpls]);
18 dataSet.push(["SMPLs per Day:", json_response.smpl_per_day.toFixed(2)]);
19 $('#{{element_name}}').DataTable( {
20 data: dataSet,
21 columns: [
22 { title: "", className: "dt_col_h1"},
23 { title: "" },
24 ]
25 } );
26});
27});
28
29</script>