Started work to re-work database; add new models for benchmarks and components
This commit is contained in:
32
views/benchmark/list.twig
Normal file
32
views/benchmark/list.twig
Normal file
@ -0,0 +1,32 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block title %}List of Benchmarks{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p><a href="{{ url_for('benchmark.add') }}">Create new Benchmark</a></p>
|
||||
|
||||
{% if benchmarks | length > 0 %}
|
||||
<table class="u-full-width">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Benchmark name</th>
|
||||
<th>Description</th>
|
||||
<th>Scoring type</th>
|
||||
<th>Last updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for b in benchmarks %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('benchmark.view', { benchmark_id: b.id }) }}">{{ b.name }}</a></td>
|
||||
<td>{{ b.description | slice(0, 100) }}</td>
|
||||
<td>{{ b.scoring }}</td>
|
||||
<td>{{ b.updated_at | date("F jS \\a\\t g:ia") }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>There are no benchmarks in the database - perhaps you should <a href="{{ url_for('benchmark.add') }}">create one</a>?</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
50
views/benchmark/view.twig
Normal file
50
views/benchmark/view.twig
Normal file
@ -0,0 +1,50 @@
|
||||
{% 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>
|
||||
<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 %}
|
30
views/component/list.twig
Normal file
30
views/component/list.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{% extends 'layout.twig' %}
|
||||
|
||||
{% block title %}List of Hardware Components{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p><a href="{{ url_for('component.add') }}">Create new Hardware Component</a></p>
|
||||
|
||||
{% if components | length > 0 %}
|
||||
<table class="u-full-width">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Component name</th>
|
||||
<th>Type</th>
|
||||
<th>Last updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for c in components %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('component.view', { component_id: c.id }) }}">{{ c.name }}</a></td>
|
||||
<td>{{ c.type }}</td>
|
||||
<td>{{ c.updated_at | date("F jS \\a\\t g:ia") }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>There are no hardware components in the database - perhaps you should <a href="{{ url_for('component.add') }}">create one</a>?</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
0
views/component/view.twig
Normal file
0
views/component/view.twig
Normal file
@ -10,7 +10,7 @@
|
||||
<script src="/js/bedabin.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{% include 'layout/navbar.twig' %}
|
||||
{% include 'partials/navbar.twig' %}
|
||||
|
||||
<div id="main-wrapper" class="container">
|
||||
{% block content %}{% endblock %}
|
||||
|
@ -3,6 +3,8 @@
|
||||
<ul class="nav-left">
|
||||
<li class="site-logo">Colossus</li>
|
||||
<li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
|
||||
<li><a href="/benchmark">Benchmarks</a></li>
|
||||
<li><a href="/component">Components</a></li>
|
||||
<li><a href="{{ url_for('test.list') }}">Test</a></li>
|
||||
<li><a href="/result">Results</a></li>
|
||||
</ul>
|
@ -32,9 +32,9 @@
|
||||
<tbody>
|
||||
{% for r in test.results %}
|
||||
<tr>
|
||||
<td>{{ r.component }}</td>
|
||||
<td>{{ r.benchmark }}</td>
|
||||
<td>{{ r.type | capitalize }}</td>
|
||||
<td>{{ test.component().name }}</td>
|
||||
<td>{{ test.benchmark().name }}</td>
|
||||
<td>{{ test.scoring | capitalize }}</td>
|
||||
<td>{{ r.average }}</td>
|
||||
<td>{{ r.minimum ? r.minimum : 'N/a' }}</td>
|
||||
<td>{{ r.maximum ? r.maximum : 'N/a' }}</td>
|
||||
|
Reference in New Issue
Block a user