Added automatic refreshing feature
This commit is contained in:
parent
f76928bc74
commit
81f89586cf
1 changed files with 26 additions and 0 deletions
|
|
@ -2,10 +2,36 @@
|
|||
{% block title %}Dashboard{% endblock %}
|
||||
{% block head_additions %}
|
||||
|
||||
<script>
|
||||
|
||||
var reloading;
|
||||
|
||||
function checkReloading() {
|
||||
if (window.location.hash=="#autoreload") {
|
||||
reloading=setTimeout("window.location.reload();", 5000);
|
||||
document.getElementById("reloadCB").checked=true;
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAutoRefresh(cb) {
|
||||
if (cb.checked) {
|
||||
window.location.replace("#autoreload");
|
||||
reloading=setTimeout("window.location.reload();", 5000);
|
||||
} else {
|
||||
window.location.replace("#");
|
||||
clearTimeout(reloading);
|
||||
}
|
||||
}
|
||||
|
||||
window.onload=checkReloading;
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Dashboard</h1>
|
||||
|
||||
<input type="checkbox" onclick="toggleAutoRefresh(this);" id="reloadCB"> Auto Refresh dashboard every 5 seconds
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
|
|
|||
Loading…
Reference in a new issue