diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-11 15:29:26 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-11 15:29:26 +0100 |
| commit | 510bf50ff2fb29817fc754d6793e506e3414bc6b (patch) | |
| tree | d4dc5c04d9bcf793593d7091607b978c1950832a /app/templates/tasks | |
| parent | 6d7b810270b21575dca54eb36f371969b976bafd (diff) | |
| download | cheatdb-510bf50ff2fb29817fc754d6793e506e3414bc6b.tar.xz | |
Remove meta refresh on task page, use JS to poll
Diffstat (limited to 'app/templates/tasks')
| -rw-r--r-- | app/templates/tasks/view.html | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/templates/tasks/view.html b/app/templates/tasks/view.html index a01ca80..d47203f 100644 --- a/app/templates/tasks/view.html +++ b/app/templates/tasks/view.html @@ -4,12 +4,6 @@ Working {% endblock %} -{% block headextra %} - {% if not "error" in info %} - <meta http-equiv="refresh" content="1;URL="> - {% endif %} -{% endblock %} - {% block content %} {% if "error" in info %} <h1>Task Failed</h1> @@ -17,5 +11,15 @@ Working <p>{{ info. error }}</p> {% else %} <h1>Working…</h1> + + <script src="/static/polltask.js"></script> + <script> + pollTask("{{ url_for('check_task', id=info.id) }}", true) + .then(function() { location.reload() }) + .catch(function() { location.reload() }) + </script> + <noscript> + Reload the page to check for updates. + </noscript> {% endif %} {% endblock %} |
