blob: 4f5298ca38e8d1ba6886c1cf0bcbe8ccbf6c2555 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
{% extends "layout.html" %}
{% load staticfiles %}
{% block style_block %}
<style>
.default {
background-color: #999;
}
.default[href]:hover,
.default[href]:focus {
background-color: #808080;
}
.primary {
background-color: #428bca;
}
.primary[href]:hover,
.primary[href]:focus {
background-color: #3071a9;
}
.success {
background-color: #5cb85c;
}
.success[href]:hover,
.success[href]:focus {
background-color: #449d44;
}
.info {
background-color: #5bc0de;
}
.info[href]:hover,
.info[href]:focus {
background-color: #31b0d5;
}
.warning {
background-color: #f0ad4e;
}
.warning[href]:hover,
.warning[href]:focus {
background-color: #ec971f;
}
.danger {
background-color: #d9534f;
}
.danger[href]:hover,
.danger[href]:focus {
background-color: #c9302c;
}
</style>
{% endblock %}
{% block content %}
<div class="container">
<div class="row">
{% include "account/sub_nav.html" %}
<div class="span12">
{% include "admin/sub_nav.html" %}
<h1>Board status</h1>
<table class="table table-bordered">
<thead>
<tr>
<th>Board MID</th>
<th>Status</th>
<th>Power Status</th>
</tr>
</thead>
<tbody>
{% for b in boards %}
<tr>
<td class = "board_id">{{ b.mid }}</td>
<td><span style="cursor: pointer;" class="label label-{% if not b.online %}important{% elif b.temp_offline %}warning{% else %}success{% endif %}">{% if not b.online %}Offline{% elif b.temp_offline %}Temp Offline{% else %}Online{% endif %}</span></td>
<td><span style = "cursor: pointer;" class = "label {% if not b.power_status %}danger{% else %}success{% endif %}">{% if not b.power_status %}OFF{% else %}ON{% endif %}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<script>
// $(window).bind("beforeunload",function(event){
// return "Please don't refresh. This will change the state of off devices to disconnected."
// });
// This function does not allow to refresh the admin page. Refreshing admin Page will change the state of device
function disableF5(e){
if ((e.which || e.keyCode) == 116 || (e.which || e.keyCode) == 82) e. preventDefault();
};
$(document).ready(function(){
$(document).on("keydown",disableF5);
});
</script>
{% endblock %}
|