diff options
author | Frederick Muriuki Muriithi | 2023-10-16 14:41:39 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-10-16 14:41:39 +0300 |
commit | c9af16ce37ccfbf75183ed0214e3a52a9d91dcc7 (patch) | |
tree | 1f6e2ae055e40fe326883cb120dc9788c2673e39 /qc_app/templates/insert_progress.html | |
parent | 0d5dc5489837957e3fab513b9dcc550eddfe53ca (diff) | |
download | gn-uploader-c9af16ce37ccfbf75183ed0214e3a52a9d91dcc7.tar.gz |
Indicate progress for data insert.
Diffstat (limited to 'qc_app/templates/insert_progress.html')
-rw-r--r-- | qc_app/templates/insert_progress.html | 16 |
1 files changed, 14 insertions, 2 deletions
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)}} |