Add more information to the Run page

This commit is contained in:
Troy Dai 2018-05-29 10:31:46 -07:00
Родитель ed7060ebd8
Коммит e7b092267a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 9608535492BEDAC8
2 изменённых файлов: 20 добавлений и 6 удалений

Просмотреть файл

@ -99,6 +99,7 @@ def run(run_id: int):
show_log = request.args.get('logs', 'False') == 'true'
query = request.args.get('query', '')
total_tasks = len(this_run.tasks)
tasks = [t for t in this_run.tasks if t.result != 'Passed']
if query:
@ -113,7 +114,7 @@ def run(run_id: int):
tasks = sorted(tasks, key=lambda t: t.name)
return render_template('run.html', run=this_run, tasks=tasks, logs=logs, query=query)
return render_template('run.html', run=this_run, tasks=tasks, logs=logs, query=query, total_tasks=total_tasks)
@app.route('/task/<int:task_id>')

Просмотреть файл

@ -2,11 +2,24 @@
{% block body %}
<div class="jumbotron jumbotron-fluid">
<div class="container">
<h1 class="display-1">Run {{ run.id }}</h1>
<p class="lead">{{ run.name }}</p>
{% if query %}
<p class="lead">The results are results of the query {{ query }}.</p>
{% endif %}
<h1 class="display-1">Run {{ run.id }}
</h1>
<h3>
{% if run.remark.lower() == 'official' %}
<span class="badge badge-primary">Official</span>
{% else %}
<span class="badge badge-primary">{{ run.remark }}</span>
{% endif %}
<span class="badge badge-danger">Failure {{ tasks | length }}</span>
<span class="badge badge-info">Total {{ total_tasks }}</span>
</h3>
<h5>
<span class="badge badge-secondary">{{ run.creation.strftime('%Y/%m/%d %H:%M') }}</span>
<span class="badge badge-secondary">{{ run.image }}</span>
{% if query %}
<span class="badge badge-secondaryu">Query {{ query }}.</span>
{% endif %}
</h5>
</div>
</div>
<div class="container-fluid">