aboutsummaryrefslogtreecommitdiff
path: root/qc_app
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-08-05 10:10:56 +0300
committerFrederick Muriuki Muriithi2022-08-05 10:10:56 +0300
commit19c376c4b60592f4bba0e26952faa3a71b6f5641 (patch)
tree0916ef296a57bb450102093429422953d92c009e /qc_app
parent3da6848381b6103fbb58eeab8d7051cba0bded58 (diff)
downloadgn-uploader-19c376c4b60592f4bba0e26952faa3a71b6f5641.tar.gz
Update job status. Display stdout and stderr outputs
* Display the status of the job, as it is running * Display STDERR output if an error occurs * Display STDOUT output as job is running and on successful completion of the job
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/dbinsert.py5
-rw-r--r--qc_app/static/css/styles.css13
-rw-r--r--qc_app/templates/insert_progress.html9
3 files changed, 21 insertions, 6 deletions
diff --git a/qc_app/dbinsert.py b/qc_app/dbinsert.py
index 70aeb6d..589ac75 100644
--- a/qc_app/dbinsert.py
+++ b/qc_app/dbinsert.py
@@ -396,7 +396,10 @@ def insert_status(job_id: str):
job = jobs.job(rconn, job_id)
if job:
- if job["status"] == "success":
+ job_status = job["status"]
+ if job_status == "success":
return render_template("insert_success.html", job=job)
+ if job["status"] == "error":
+ return render_template("insert_error.html", job=job)
return render_template("insert_progress.html", job=job)
return render_template("no_such_job.html", job_id=job_id), 400
diff --git a/qc_app/static/css/styles.css b/qc_app/static/css/styles.css
index 5340701..d20c1fb 100644
--- a/qc_app/static/css/styles.css
+++ b/qc_app/static/css/styles.css
@@ -2,6 +2,10 @@
box-sizing: border-box;
}
+body {
+ padding: 0 1em 0 1em;
+}
+
label, legend {
text-transform: capitalize;
}
@@ -130,3 +134,12 @@ form legend {
font-weight: bolder;
line-height: 2em;
}
+
+.cli-output {
+ background: black;
+ color: #00DD00;
+ padding: 1em;
+ font-weight: bold;
+ border-radius: 0.8em;
+ width: 55em;
+}
diff --git a/qc_app/templates/insert_progress.html b/qc_app/templates/insert_progress.html
index 1ac6212..52beaa4 100644
--- a/qc_app/templates/insert_progress.html
+++ b/qc_app/templates/insert_progress.html
@@ -1,4 +1,5 @@
{%extends "base.html"%}
+{%from "stdout_output.html" import stdout_output%}
{%block extrameta%}
<meta http-equiv="refresh" content="5">
@@ -7,18 +8,16 @@
{%block title%}Job Status{%endblock%}
{%block contents%}
-<h1 class="heading">{{job_name}}</h2>
+<h1 class="heading">{{job_name}}</h1>
<label for="job_status">status:</label>
<span>{{job_status}}: {{message}}</span><br />
-{{job}}
<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>
-<div>
- {{job.stderr}}
-</div>
+
+{{stdout_output(job)}}
{%endblock%}