Started adding test model/routes/views; removed a bit of the old paradigm with tying results directly to hardware

This commit is contained in:
2025-06-10 17:35:52 -04:00
parent 883019b181
commit 47cb580393
16 changed files with 343 additions and 85 deletions

View File

@ -11,79 +11,3 @@
Hardware type: <%= hardware.type %>
</div>
</div>
<hr>
<div class="grix-x grix-margin-x">
<div class="cell small-12">
<form class="u-full-width" action="/result/add" method="post">
<input type="hidden" name="result_hardware" value="<%= hardware.id %>">
<input type="hidden" name="result_referrer" value="hardware">
<div class="grid-x grid-margin-x">
<div class="cell medium-5">
<label for="result_benchmark">
Add benchmark result:
<select class="u-full-width" id="result_benchmark" name="result_benchmark">
<% benchmarks.each do |b| %>
<option value="<%= b.id %>"><%= b.name %></option>
<% end %>
</select>
</label>
</div>
<div class="cell medium-2">
<label for="result_average">
Average score:
<input type="text" id="result_average" name="result_average" value="">
</label>
</div>
<div class="cell medium-2">
<label for="result_minimum">
Minimum score:
<input type="text" id="result_minimum" name="result_minimum" value="">
</label>
</div>
<div class="cell medium-2">
<label for="result_maximum">
Maximum score:
<input type="text" id="result_maximum" name="result_maximum" value="">
</label>
</div>
<div class="cell medium-1">
<input type="submit" class="u-full-width button" value="Submit">
</div>
</div>
</form>
<hr>
<h4>Benchmark results involving this hardware:</h4>
<table>
<thead>
<th>Benchmark name</th>
<th>Scoring type</th>
<th># results</th>
<th>Average</th>
<th>Minimum</th>
<th>Maximum</th>
</thead>
<tbody>
<% hardware.bench_results().each do |k, r| %>
<tr>
<td><%= k %></td>
<td>N/a</td>
<td><%= r.length %></td>
<td><%= average_array(r) %></td>
<td>N/a</td>
<td>N/a</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>