morffix/tmpl/task.tmpl
2024-06-25 21:25:35 +02:00

44 lines
No EOL
1.3 KiB
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>
<p>Type: {{.Type}}</p>
<p>Status: {{.Status}}</p>
<p>Worker: {{.Worker}}</p>
<p>Library: {{.Library}}</p>
<p>Filename: {{.Filename}}</p>
<p>Updated At: {{.UpdatedAt}}</p>
<button type="button" onclick="window.scrollTo(0,document.body.scrollHeight);" class="short-button">Scroll to Bottom</button>
<div class="log">
{{range $t := .Log}}
<p>
{{ $t }}
</p>
{{end}}
</div>
<input type="checkbox" onclick="toggleAutoRefresh(this);" id="reloadCB" class="short-button"> Auto Follow</input>
<button type="button" onclick="window.scrollTo(0,0);" class="short-button">Scroll to Top</button>
{{template "tail"}}