Add Auto Follow Task Log
This commit is contained in:
parent
dab7c18321
commit
896ab0edc3
1 changed files with 26 additions and 1 deletions
|
@ -1,6 +1,30 @@
|
|||
{{template "head"}}
|
||||
<h2>Task {{.ID}}</h2>
|
||||
<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>
|
||||
|
@ -8,4 +32,5 @@
|
|||
</p>
|
||||
{{end}}
|
||||
</div>
|
||||
<input type="checkbox" onclick="toggleAutoRefresh(this);" id="reloadCB"> Auto Follow
|
||||
{{template "tail"}}
|
Loading…
Add table
Reference in a new issue