Added routes and views for adding and listing benchmarks and components
This commit is contained in:
38
views/component/add.twig
Normal file
38
views/component/add.twig
Normal file
@ -0,0 +1,38 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block title %}Add New Component{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<h1>Add new component</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<form action="{{ url_for('component.add') }}" method="POST" class="u-full-width">
|
||||
<div class="row">
|
||||
<div class="nine columns">
|
||||
<label for="component_name">Component name:</label>
|
||||
<input type="text" id="component_name" class="u-full-width" name="component_name">
|
||||
</div>
|
||||
|
||||
<div class="three columns">
|
||||
<label>
|
||||
Component type:
|
||||
<select class="u-full-width" name="component_type">
|
||||
<option value="gpu">Graphics card</option>
|
||||
<option value="cpu">Processor</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input class="button button-primary u-full-width" type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -0,0 +1,50 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block title %}Component: {{ component.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<h1>{{ component.name }}</h1>
|
||||
<p>{{ component.type }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<h3>Test results:</h3>
|
||||
<p><a href="{{ url_for('result.add') }}">Add new result</a></p>
|
||||
|
||||
{% if test.results | length > 0 %}
|
||||
<table class="u-full-width">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Component</th>
|
||||
<th>Benchmark</th>
|
||||
<th>Scoring</th>
|
||||
<th>Avg.</th>
|
||||
<th>Min.</th>
|
||||
<th>Max.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in test.results %}
|
||||
<tr>
|
||||
<td>{{ r.component }}</td>
|
||||
<td>{{ r.benchmark }}</td>
|
||||
<td>{{ r.type | capitalize }}</td>
|
||||
<td>{{ r.average }}</td>
|
||||
<td>{{ r.minimum ? r.minimum : 'N/a' }}</td>
|
||||
<td>{{ r.maximum ? r.maximum : 'N/a' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>There are no results associated with this.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user