aboutsummaryrefslogtreecommitdiff
path: root/templates/_footer.tmpl
blob: 97a5bf86321cb9dfb79e36f15c192f3bb67392ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{{ define "_footer" }}
    </main>
    </section>
<script>
  function deleteEntry(id) {
    fetch("/entries/"+id, { method: 'DELETE' })
        .then((res)=>{
            window.location.href = '/'
        });
    }

  function getStatus() {
    fetch("/jobs/", { method: 'GET'})
        .then((res) => { return objs = res.json(); })
        .then((objs) => {
            for (i in objs) {
                 span = document.getElementById("status_"+objs[i].Id);
                 span.textContent = objs[i].Status;
            }
          });
    }

setInterval(getStatus, 1000);

</script>
  </body>
</html>
{{ end }}