morffix/tmpl/task.tmpl

36 lines
No EOL
885 B
Cheetah

{{template "head"}}
<script type="text/javascript">
var reloading;
function checkReloading() {
if (window.location.hash=="#autoreload") {
window.scrollTo(0,document.body.scrollHeight);
reloading=setTimeout("window.location.reload();", 2000);
document.getElementById("reloadCB").checked=true;
}
}
function toggleAutoRefresh(cb) {
if (cb.checked) {
window.location.replace("#autoreload");
reloading=setTimeout("window.location.reload();", 2000);
} else {
window.location.replace("#");
clearTimeout(reloading);
}
}
window.onload = function(e){
checkReloading();
}
</script>
<h2>Task {{.ID}}</h2>
<div class="log">
{{range $t := .Log}}
<p>
{{ $t }}
</p>
{{end}}
</div>
<input type="checkbox" onclick="toggleAutoRefresh(this);" id="reloadCB"> Auto Follow
{{template "tail"}}