summaryrefslogtreecommitdiff
path: root/views/batch.haml
diff options
context:
space:
mode:
Diffstat (limited to 'views/batch.haml')
-rw-r--r--views/batch.haml9
1 files changed, 9 insertions, 0 deletions
diff --git a/views/batch.haml b/views/batch.haml
index 3f54772..45997bf 100644
--- a/views/batch.haml
+++ b/views/batch.haml
@@ -1,3 +1,12 @@
+:javascript
+ // kill task pid if page is reloaded, `false` makes the request synchronous
+ window.addEventListener('unload', ktpid, false);
+ function ktpid() {
+ var client = new XMLHttpRequest();
+ client.open("GET", "#{to("/prediction/task?ktpid=#{@pid}")}", false);
+ client.setRequestHeader("Content-Type", "application/json");
+ client.send(null);
+ };
%div.card
%a.btn.btn-outline-info{:href => to("/predict?tpid=#{@pid}")}
%span.fa.fa-caret-left{:aria=>{:hidden=>"true"}}