Added option to automatically refresh the logs page

This commit is contained in:
Patrick Speiser
2012-10-05 04:53:10 +02:00
parent defdfa9c69
commit 316a2b592b

View File

@@ -18,6 +18,18 @@ lossless<%inherit file="base.html"/>
<tbody>
</tbody>
</table>
<br>
<div align="center">Refresh rate:
<select id="refreshrate" onchange="setRefresh()">
<option value="0" selected="selected">No Refresh</option>
<option value="5">5 Seconds</option>
<option value="15">15 Seconds</option>
<option value="30">30 Seconds</option>
<option value="60">60 Seconds</option>
<option value="300">5 Minutes</option>
<option value="600">10 Minutes</option>
</select></div>
</%def>
<%def name="headIncludes()">
@@ -63,4 +75,22 @@ $(document).ready(function() {
} );
} );
</script>
<script>
var timer;
function setRefresh()
{
refreshrate = document.getElementById('refreshrate');
if(refreshrate != null)
{
if(timer)
{
clearInterval(timer);
}
if(refreshrate.value != 0)
{
timer = setInterval("$('#log_table').dataTable().fnDraw()",1000*refreshrate.value);
}
}
}
</script>
</%def>