Add Auto Follow Task Log

This commit is contained in:
Samuel Lorch 2024-06-23 03:02:33 +02:00
parent dab7c18321
commit 896ab0edc3

View file

@ -1,6 +1,30 @@
{{template "head"}} {{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"> <div class="log">
{{range $t := .Log}} {{range $t := .Log}}
<p> <p>
@ -8,4 +32,5 @@
</p> </p>
{{end}} {{end}}
</div> </div>
<input type="checkbox" onclick="toggleAutoRefresh(this);" id="reloadCB"> Auto Follow
{{template "tail"}} {{template "tail"}}