Commit 7aa8be74 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Remove 'you will receive a mail' for standalone mode + refresh every second in...

Remove 'you will receive a mail' for standalone mode + refresh every second in standalone mode, Fixes #116
parent 4e7cc0a6
...@@ -2,9 +2,11 @@ if (!dgenies) { ...@@ -2,9 +2,11 @@ if (!dgenies) {
throw "dgenies wasn't included!" throw "dgenies wasn't included!"
} }
dgenies.status = {}; dgenies.status = {};
dgenies.status.mode = "webserver";
dgenies.status.init = function (status) { dgenies.status.init = function (status, mode) {
dgenies.status.mode = mode;
if (status !== "success" && status !== "done" && status !== "no-match" && status !== "fail") { if (status !== "success" && status !== "done" && status !== "no-match" && status !== "fail") {
dgenies.status.autoreload(); dgenies.status.autoreload();
} }
...@@ -29,6 +31,11 @@ dgenies.status.autoreload = function () { ...@@ -29,6 +31,11 @@ dgenies.status.autoreload = function () {
} }
} }
setTimeout(function(){ setTimeout(function(){
window.location.replace(`?refresh=${refresh}&count=${count}`); if (dgenies.status.mode === "webserver") {
window.location.replace(`?refresh=${refresh}&count=${count}`);
}
else {
window.location.replace(`?refresh=1&count=1`);
}
}, refresh * 1000) }, refresh * 1000)
}; };
...@@ -3,54 +3,32 @@ ...@@ -3,54 +3,32 @@
{{ super() }} {{ super() }}
<script src="{{ url_for('static', filename='js/dgenies.status.js') }}" type="text/JavaScript"></script> <script src="{{ url_for('static', filename='js/dgenies.status.js') }}" type="text/JavaScript"></script>
{% endblock %} {% endblock %}
{% block onload %}dgenies.status.init('{{ status }}');{% endblock %} {% block onload %}dgenies.status.init('{{ status }}', '{{ mode }}');{% endblock %}
{% block content %} {% block content %}
<h2 class="status">Job name: {{ id_job }}</h2> <h2 class="status">Job name: {{ id_job }}</h2>
<div class="status-body"> <div class="status-body">
{% if status == "started" %} {% if status == "started" %}
<p>Your job has started.<br/> <p>Your job has started.<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "starting" %} {% elif status == "starting" %}
<p>Your job is starting...<br/> <p>Your job is starting...<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "scheduled-cluster" %} {% elif status == "scheduled-cluster" %}
<p>Your job has been scheduled on the cluster.<br/> <p>Your job has been scheduled on the cluster.<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "submitted" or status == "waiting" %} {% elif status == "submitted" or status == "waiting" %}
<p>Your job has been submitted.<br/> <p>Your job has been submitted.<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "getfiles" %} {% elif status == "getfiles" %}
<p>Your job has been submitted. We are retrieving data...<br/> <p>Your job has been submitted. We are retrieving data...<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "getfiles-waiting" %} {% elif status == "getfiles-waiting" %}
<p>Your job has been submitted. We are retrieving data... (waiting for download...)<br/> <p>Your job has been submitted. We are retrieving data... (waiting for download...)<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "merging" %} {% elif status == "merging" %}
<p>Your map is done. We are preparing files for visualisation...<br/> <p>Your map is done. We are preparing files for visualisation...<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "preparing" or status == "preparing-cluster" %} {% elif status == "preparing" or status == "preparing-cluster" %}
<p>We are preparing data...<br/> <p>We are preparing data...<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "prepare-scheduled" %} {% elif status == "prepare-scheduled" %}
<p>We are preparing data... [scheduled]<br/> <p>We are preparing data... [scheduled]<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "prepared"%} {% elif status == "prepared"%}
<p>Your data are ready to be processed. Your job will be scheduled soon...<br/> <p>Your data are ready to be processed. Your job will be scheduled soon...<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "scheduled" %} {% elif status == "scheduled" %}
<p>Your job has been shedulded. It will start soon...<br/> <p>Your job has been shedulded. It will start soon...<br/>
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% elif status == "success" %} {% elif status == "success" %}
<p>Your job was completed successfully.<br/> <p>Your job was completed successfully.<br/>
Please <a href="/result/{{ id_job }}">click here</a> to show results.</p> Please <a href="/result/{{ id_job }}">click here</a> to show results.</p>
...@@ -81,6 +59,14 @@ ...@@ -81,6 +59,14 @@
{% else %} {% else %}
<p>This job does not exists!</p> <p>This job does not exists!</p>
{% endif %} {% endif %}
{% if status not in ["success", "no_match", "fail"] %}
{% if mode == "webserver" %}
You will receive an email when it will be finished.<br/>
Alternatively, you can refresh this page to update status.</p>
{% else %}
This page will refresh automatically.</p>
{% endif %}
{% endif %}
</div> </div>
<div class="progress-status"> <div class="progress-status">
<div class="progress-status-bar {{ status }}"><div class="inner"></div></div> <div class="progress-status-bar {{ status }}"><div class="inner"></div></div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment