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) {
throw "dgenies wasn't included!"
}
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") {
dgenies.status.autoreload();
}
......@@ -29,6 +31,11 @@ dgenies.status.autoreload = function () {
}
}
setTimeout(function(){
if (dgenies.status.mode === "webserver") {
window.location.replace(`?refresh=${refresh}&count=${count}`);
}
else {
window.location.replace(`?refresh=1&count=1`);
}
}, refresh * 1000)
};
......@@ -3,54 +3,32 @@
{{ super() }}
<script src="{{ url_for('static', filename='js/dgenies.status.js') }}" type="text/JavaScript"></script>
{% endblock %}
{% block onload %}dgenies.status.init('{{ status }}');{% endblock %}
{% block onload %}dgenies.status.init('{{ status }}', '{{ mode }}');{% endblock %}
{% block content %}
<h2 class="status">Job name: {{ id_job }}</h2>
<div class="status-body">
{% if status == "started" %}
<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" %}
<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" %}
<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" %}
<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" %}
<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" %}
<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" %}
<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" %}
<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" %}
<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"%}
<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" %}
<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" %}
<p>Your job was completed successfully.<br/>
Please <a href="/result/{{ id_job }}">click here</a> to show results.</p>
......@@ -81,6 +59,14 @@
{% else %}
<p>This job does not exists!</p>
{% 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 class="progress-status">
<div class="progress-status-bar {{ status }}"><div class="inner"></div></div>
......
Supports Markdown
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