Added Test class to track benchmark groups
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
<ul class="nav-left">
|
||||
<li class="site-logo">Colossus</li>
|
||||
<li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
|
||||
<li><a href="{{ url_for('test.list') }}">Test</a></li>
|
||||
<li><a href="/result">Results</a></li>
|
||||
</ul>
|
||||
|
||||
|
@ -14,11 +14,19 @@
|
||||
<div class="twelve columns">
|
||||
<form action="{{ url_for('result.add') }}" method="POST" class="u-full-width">
|
||||
<div class="row">
|
||||
<div class="six columns">
|
||||
<div class="four columns">
|
||||
<label for="result_test">Associated test:</label>
|
||||
<select name="result_test" id="result_test" class="u-full-width">
|
||||
{% for t in tests %}
|
||||
<option value="{{ t.id }}">{{ t.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="four columns">
|
||||
<label for="result_component">Hardware name:</label>
|
||||
<input type="text" id="result_component" class="u-full-width" name="result_component">
|
||||
</div>
|
||||
<div class="six columns">
|
||||
<div class="four columns">
|
||||
<label for="result_benchmark">Benchmark used:</label>
|
||||
<input type="text" id="result_benchmark" class="u-full-width" name="result_benchmark">
|
||||
</div>
|
||||
|
35
views/test/add.twig
Normal file
35
views/test/add.twig
Normal file
@ -0,0 +1,35 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block title %}Add New Test{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<h1>Add new test</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<form action="{{ url_for('test.add') }}" method="POST" class="u-full-width">
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<label for="test_name">Test name:</label>
|
||||
<input type="text" id="test_name" class="u-full-width" name="test_name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<label for="test_description">Description</label>
|
||||
<textarea class="u-full-width" name="test_description" id="test_description" placeholder="Describe this test..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input class="button button-primary u-full-width" type="submit" value="Submit">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
28
views/test/list.twig
Normal file
28
views/test/list.twig
Normal file
@ -0,0 +1,28 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block title %}List of Tests{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>Tests list...</p>
|
||||
|
||||
{% if tests | length > 0 %}
|
||||
<table class="u-full-width">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Test name</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for t in tests %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('test.view', { test_id: t.id }) }}">{{ t.name }}</a></td>
|
||||
<td>{{ t.description | slice(0, 100) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>There are no tests in the database - perhaps you should <a href="{{ url_for('test.add') }}">create one</a>?</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
49
views/test/view.twig
Normal file
49
views/test/view.twig
Normal file
@ -0,0 +1,49 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block title %}Test: {{ test.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<h1>{{ test.name }}</h1>
|
||||
<p>{{ test.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="twelve columns">
|
||||
<h3>Test results:</h3>
|
||||
|
||||
{% 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