Added API routes to provide some information for JS; added CoffeeScript to grab benchmark results for a test

This commit is contained in:
2025-06-19 00:38:36 -04:00
parent d17b66920a
commit 8cd47d7e70
8 changed files with 96 additions and 16 deletions

View File

@ -25,7 +25,7 @@
<tbody>
<% tests.each do |t| %>
<tr>
<td><a href="/hardware/<%= t.id %>"><%= t.name %></a></td>
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
<td><%= t.benchmark.length %></td>
<td><%= date_format(t.created_at) %></td>
<td><%= date_format(t.updated_at) %></td>

View File

@ -21,7 +21,7 @@
<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="<%= test.id %>">
<input type="hidden" name="result_test" value="<%= test.id %>">
<input type="hidden" name="result_referrer" value="test">
<div class="grid-x grid-margin-x">
@ -67,18 +67,25 @@
<h4>Benchmark results for this test:</h4>
<table>
<table id="results-table" data-test-id="<%= test.id %>">
<thead>
<th>Benchmark name</th>
<th>Scoring type</th>
<th># results</th>
<th>Average</th>
<th>Minimum</th>
<th>Maximum</th>
<tr>
<th>Benchmark name</th>
<th>Scoring type</th>
<th># results</th>
<th>Average</th>
<th>Minimum</th>
<th>Maximum</th>
</tr>
</thead>
<tbody>
<% test.benchmark.each do |benchmark| %>
<tr data-benchmark-id="<%= benchmark.id %>"></tr>
<% end %>
</tbody>
</table>
</div>
</div>
<!-- load test data fetching functionality -->
<script src="/js/test.js" charset="utf-8"></script>