Allow jobs to show parameters in the UI (#601)

* Allow jobs to show parameters in the UI

This is very useful when starting the same job multiple times with
different configurations.

This PR allows to show parameters as arbitrary data since jobs might use
any kind of data.

* Use same method of pretty printing everywhere
This commit is contained in:
totycro
2021-01-05 16:32:51 +01:00
committed by GitHub
parent ada70fff6e
commit 497875c3a5
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -2006,6 +2006,7 @@ tiles/{{{}}}/{{{}}}/{{{}}}/{{{}}}?f=mvt'
'status': job_['status'],
'message': job_['message'],
'progress': job_['progress'],
'parameters': job_.get('parameters'),
'job_start_datetime': job_['job_start_datetime'],
'job_end_datetime': job_['job_end_datetime']
}
@@ -23,6 +23,15 @@
<h3>Message</h3>
<p>{{ data['jobs']['message'] }}</p>
</div>
{% if data['jobs']['parameters'] %}
<div class="message">
<h3>Parameters</h3>
<pre id="job-parameters"></pre>
</div>
<script>
document.getElementById('job-parameters').innerHTML = JSON.stringify({{ data['jobs']['parameters']}}, undefined, 2);
</script>
{% endif %}
<div class="duration">
<h4><label for="progress">Progress</label></h4>
<progress id="progress" class="inline" value="{{ data['jobs']['progress']|int*10 }}" max="1000"></progress>