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

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

@ -2,11 +2,24 @@
{% block body %} {% block body %}
<div class="jumbotron jumbotron-fluid"> <div class="jumbotron jumbotron-fluid">
<div class="container"> <div class="container">
<h1 class="display-1">Run {{ run.id }}</h1> <h1 class="display-1">Run {{ run.id }}
<p class="lead">{{ run.name }}</p> </h1>
{% if query %} <h3>
<p class="lead">The results are results of the query {{ query }}.</p> {% if run.remark.lower() == 'official' %}
<span class="badge badge-primary">Official</span>
{% else %}
<span class="badge badge-primary">{{ run.remark }}</span>
{% endif %} {% 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> </div>
<div class="container-fluid"> <div class="container-fluid">