dev-data.html 1.04 KB
Newer Older
Vladislav Rykov's avatar
Vladislav Rykov committed
1
2
3
4
5
6
7
8
{% extends 'layout.html' %}

{% block title %} Device Data: {% endblock %}

{% block content %}

<div class="row">
	<div class="col-md-6 col-md-offset-3">
Vladislav Rykov's avatar
Vladislav Rykov committed
9
10
11
12
13
14
15
		<div class="panel panel-success">
			<div class="panel-heading">
				<h2><center> {{ devname }} data </center></h2>
			</div>
			<div class="panel-body">
				{% if data %}
				<p>Last {{ lastctr }} messages:</p>
Vladislav Rykov's avatar
Vladislav Rykov committed
16
		
Vladislav Rykov's avatar
Vladislav Rykov committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
				<table class="table">
					<thead>
						<th>Time</th>
						<th>Content</th>
					</thead>
					<tbody>
					{% for d in data %}
						<tr>
							<th> {{ d[1] }} </th>
							<th> {{ d[2] }} </th>
						</tr>
					{% endfor %}
					</tbody>
				</table>

				<p>Total: <strong>{{ total }}</strong> messages.</p>

				<center>
				<a href="/data-csv"><button type="submit" class="btn btn-primary">Download CSV</button></a>
				</center>
				{% else %}
38
				<h3><center>Device have not sent any data yet.</center></h3>
Vladislav Rykov's avatar
Vladislav Rykov committed
39
				{% endif %}
Vladislav Rykov's avatar
Vladislav Rykov committed
40
41
42
43
44
45
46
47
48
49
50
	</div>
</div>

<script type="text/javascrypt">
function conf() {
	return confirm("Are you sure? It will remove all device data.")
}
</script>

{% endblock %}