aboutsummaryrefslogtreecommitdiff
path: root/qc_app/templates
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-10-16 14:41:39 +0300
committerFrederick Muriuki Muriithi2023-10-16 14:41:39 +0300
commitc9af16ce37ccfbf75183ed0214e3a52a9d91dcc7 (patch)
tree1f6e2ae055e40fe326883cb120dc9788c2673e39 /qc_app/templates
parent0d5dc5489837957e3fab513b9dcc550eddfe53ca (diff)
downloadgn-uploader-c9af16ce37ccfbf75183ed0214e3a52a9d91dcc7.tar.gz
Indicate progress for data insert.
Diffstat (limited to 'qc_app/templates')
-rw-r--r--qc_app/templates/continue_from_create_dataset.html4
-rw-r--r--qc_app/templates/continue_from_create_study.html4
-rw-r--r--qc_app/templates/dbupdate_hidden_fields.html3
-rw-r--r--qc_app/templates/final_confirmation.html2
-rw-r--r--qc_app/templates/insert_progress.html16
-rw-r--r--qc_app/templates/select_dataset.html4
-rw-r--r--qc_app/templates/select_platform.html1
-rw-r--r--qc_app/templates/select_study.html6
8 files changed, 29 insertions, 11 deletions
diff --git a/qc_app/templates/continue_from_create_dataset.html b/qc_app/templates/continue_from_create_dataset.html
index 1e493c5..4358b11 100644
--- a/qc_app/templates/continue_from_create_dataset.html
+++ b/qc_app/templates/continue_from_create_dataset.html
@@ -27,7 +27,7 @@
<legend>continue with new dataset</legend>
{{hidden_fields(
filename, filetype, species=species, genechipid=genechipid,
- studyid=studyid, datasetid=datasetid)}}
+ studyid=studyid, datasetid=datasetid, totallines=totallines)}}
<fieldset>
<input type="submit"
@@ -44,7 +44,7 @@
<legend>Select from existing dataset</legend>
{{hidden_fields(
filename, filetype, species=species, genechipid=genechipid,
- studyid=studyid, datasetid=datasetid)}}
+ studyid=studyid, datasetid=datasetid, totallines=totallines)}}
<fieldset>
<input type="submit"
diff --git a/qc_app/templates/continue_from_create_study.html b/qc_app/templates/continue_from_create_study.html
index fecb19b..3684f57 100644
--- a/qc_app/templates/continue_from_create_study.html
+++ b/qc_app/templates/continue_from_create_study.html
@@ -27,7 +27,7 @@
<legend>continue with new study</legend>
{{hidden_fields(
filename, filetype, species=species, genechipid=genechipid,
- studyid=studyid)}}
+ studyid=studyid, totallines=totallines)}}
<fieldset>
<input type="submit"
@@ -44,7 +44,7 @@
<legend>Select from existing study</legend>
{{hidden_fields(
filename, filetype, species=species, genechipid=genechipid,
- studyid=studyid)}}
+ studyid=studyid, totallines=totallines)}}
<fieldset>
<input type="submit"
diff --git a/qc_app/templates/dbupdate_hidden_fields.html b/qc_app/templates/dbupdate_hidden_fields.html
index 5a95cbb..ccbc299 100644
--- a/qc_app/templates/dbupdate_hidden_fields.html
+++ b/qc_app/templates/dbupdate_hidden_fields.html
@@ -4,6 +4,9 @@
<input type="hidden" name="filename" value="{{filename}}" />
<input type="hidden" name="filetype" value="{{filetype}}" />
+{%if kwargs.get("totallines")%}
+<input type="hidden" name="totallines" value="{{kwargs['totallines']}}" />
+{%endif%}
{%if kwargs.get("species"):%}
<input type="hidden" name="species" value="{{kwargs['species']}}" />
{%endif%}
diff --git a/qc_app/templates/final_confirmation.html b/qc_app/templates/final_confirmation.html
index 018f8d6..b08e1f5 100644
--- a/qc_app/templates/final_confirmation.html
+++ b/qc_app/templates/final_confirmation.html
@@ -38,7 +38,7 @@
<form method="POST" action="{{url_for('dbinsert.insert_data')}}">
{{hidden_fields(
filename, filetype, species=species, genechipid=genechipid,
- studyid=studyid,datasetid=datasetid)}}
+ studyid=studyid,datasetid=datasetid, totallines=totallines)}}
<fieldset>
<input type="submit" class="btn btn-main" value="confirm" />
</fieldset>
diff --git a/qc_app/templates/insert_progress.html b/qc_app/templates/insert_progress.html
index 52beaa4..0e1a9e0 100644
--- a/qc_app/templates/insert_progress.html
+++ b/qc_app/templates/insert_progress.html
@@ -13,9 +13,21 @@
<label for="job_status">status:</label>
<span>{{job_status}}: {{message}}</span><br />
+{%if job.get("stdout", "").split("\n\n") | length < 3 %}
+{%set lines = 0%}
+{%else%}
+{%set lines = (job.get("stdout", "").split("\n\n") | length / 3) %}
+{%endif%}
+{%set totallines = job.get("totallines", lines+3) | int %}
+{%if totallines > 1000 %}
+{%set fraction = ((lines*1000)/totallines) %}
+{%else%}
+{%set fraction = (lines/totallines)%}
+{%endif%}
+
<label for="job_{{job_id}}">inserting: </label>
-<progress id="job_{{job_id}}" value="{{(job['percent'] | float) / 100}}">{{job["percent"]}}</progress>
-<span>{{"%.2f" | format(job['percent'] | float)}}%</span>
+<progress id="jobs_{{job_id}}" value="{{(fraction)}}">{{fraction*100}}</progress>
+<span>{{"%.2f" | format(fraction * 100 | float)}}%</span><br />
{{stdout_output(job)}}
diff --git a/qc_app/templates/select_dataset.html b/qc_app/templates/select_dataset.html
index a16fc75..a21957d 100644
--- a/qc_app/templates/select_dataset.html
+++ b/qc_app/templates/select_dataset.html
@@ -16,7 +16,7 @@
<legend>choose existing dataset</legend>
{{hidden_fields(
filename, filetype, species=species, genechipid=genechipid,
- studyid=studyid)}}
+ studyid=studyid, totallines=totallines)}}
<fieldset>
<label for="datasetid" class="form-col-1">dataset:</label>
@@ -49,7 +49,7 @@
<legend>create new dataset</legend>
{{hidden_fields(
filename, filetype, species=species, genechipid=genechipid,
- studyid=studyid)}}
+ studyid=studyid, totallines=totallines)}}
{%with messages = get_flashed_messages(with_categories=true)%}
{%if messages:%}
diff --git a/qc_app/templates/select_platform.html b/qc_app/templates/select_platform.html
index 3ceae01..dadf779 100644
--- a/qc_app/templates/select_platform.html
+++ b/qc_app/templates/select_platform.html
@@ -9,6 +9,7 @@
id="select-platform-form" data-genechips="{{genechips_data}}">
<input type="hidden" name="filename" value="{{filename}}" />
<input type="hidden" name="filetype" value="{{filetype}}" />
+ <input type="hidden" name="totallines" value="{{totallines}}" />
<fieldset>
<label for="species" class="form-col-1">species</label>
diff --git a/qc_app/templates/select_study.html b/qc_app/templates/select_study.html
index d8bdcf0..36d1299 100644
--- a/qc_app/templates/select_study.html
+++ b/qc_app/templates/select_study.html
@@ -15,7 +15,8 @@
id="select-platform-form" data-genechips="{{genechips_data}}"
class="two-col-sep-col1">
<legend>Select from existing study</legend>
- {{hidden_fields(filename, filetype, species=species, genechipid=genechipid)}}
+ {{hidden_fields(filename, filetype, species=species, genechipid=genechipid,
+ totallines=totallines)}}
<fieldset>
<label for="study" class="form-col-1">study:</label>
@@ -50,7 +51,8 @@
{%endif%}
{%endwith%}
<legend>Create new study</legend>
- {{hidden_fields(filename, filetype, species=species, genechipid=genechipid)}}
+ {{hidden_fields(filename, filetype, species=species, genechipid=genechipid,
+ totallines=totallines)}}
<fieldset>
<label for="studyname" class="form-col-1">name:</label>