This commit is contained in:
@ -24,7 +24,7 @@ fetchTestBenchmarkResults = (testId, benchmarkId) ->
|
||||
|
||||
tableRow = $("#results-table tr[data-benchmark-id=#{benchmarkId}]")
|
||||
|
||||
tableRow.append('<td>' + benchmarkData.name + '</td>')
|
||||
tableRow.append('<td><a href="/benchmark/' + benchmarkData.id + '">' + benchmarkData.name + '</a></td>')
|
||||
tableRow.append('<td>' + benchmarkData.scoring + '</td>')
|
||||
tableRow.append('<td>' + resultData.length + '</td>')
|
||||
|
||||
|
@ -7,6 +7,9 @@ $primary-color-highlight: color.adjust($primary-color, $lightness: -10%)
|
||||
body
|
||||
background: rgb(240, 235, 248)
|
||||
|
||||
table
|
||||
border: 1px solid #666
|
||||
|
||||
#wrapper
|
||||
background: white
|
||||
padding: 1.5rem 2rem
|
||||
|
@ -3,6 +3,7 @@
|
||||
# Benchmark - database model for PC benchmarks
|
||||
class Benchmark < Sequel::Model
|
||||
|
||||
many_to_many :tests
|
||||
one_to_many :results
|
||||
|
||||
end
|
||||
|
@ -5,6 +5,6 @@ class Test < Sequel::Model
|
||||
|
||||
one_to_many :result
|
||||
many_to_one :hardware
|
||||
many_to_many :benchmark
|
||||
many_to_many :benchmarks
|
||||
|
||||
end
|
||||
|
@ -16,3 +16,34 @@
|
||||
<p><%= benchmark.description %></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h3 class="mb-3">Tests using this benchmark:</h3>
|
||||
|
||||
<% if benchmark.tests.length > 0 %>
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Test title</th>
|
||||
<th>Benchmarks</th>
|
||||
<th>Last updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% benchmark.tests.each do |t| %>
|
||||
<tr>
|
||||
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
||||
<td><%= t.benchmarks.length %></td>
|
||||
<td><%= t.updated_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>There are no tests associated with this benchmark.</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -11,3 +11,34 @@
|
||||
Hardware type: <%= hardware.type %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h3 class="mb-3">Tests using this benchmark:</h3>
|
||||
|
||||
<% if hardware.tests.length > 0 %>
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Test title</th>
|
||||
<th>Benchmarks</th>
|
||||
<th>Last updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% hardware.tests.each do |t| %>
|
||||
<tr>
|
||||
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
||||
<td><%= t.benchmarks.length %></td>
|
||||
<td><%= t.updated_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% else %>
|
||||
<p>There are no tests associated with this benchmark.</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<div class="row">
|
||||
<% if tests.length > 0 %>
|
||||
<div class="twelve columns">
|
||||
<div class="12-col mb-3">
|
||||
<h2>Latest benchmark results:</h2>
|
||||
</div>
|
||||
|
||||
<div class="twelve columns">
|
||||
<table>
|
||||
<thead>
|
||||
<div class="12-col">
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Test name</th>
|
||||
<th># Benchmarks</th>
|
||||
@ -25,7 +25,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="twelve columns">
|
||||
<div class="12-col">
|
||||
<p>I'm sorry, there don't appear to be any benchmark results logged yet. Check again later!</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div id="main-nav" class="navbar navbar-expand-md bg-body-secondary mb-3">
|
||||
<div id="main-nav" class="navbar navbar-expand-md bg-dark border-bottom border-body mb-3" data-bs-theme="dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand mb-0 h1" href="#">Game Data</a>
|
||||
|
||||
|
@ -1,30 +1,36 @@
|
||||
<div class="row">
|
||||
<form class="col-12" action="/reports" method="post">
|
||||
<div class="grid-x grid-margin-x">
|
||||
<select class="col-12 col-md-6 form-select" id="report_type" name="report_type" disabled>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 col-md-6">
|
||||
<select id="report_type" class="form-select" name="report_type" disabled>
|
||||
<option value="benchmark">Benchmark</option>
|
||||
<option value="test">Test</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<select class="col-12 col-md-6 form-select" id="report_choice" name="report_choice">
|
||||
<div class="col-12 col-md-6">
|
||||
<select id="report_choice" class="form-select" name="report_choice">
|
||||
<% benchmarks.each do |b| %>
|
||||
<option value="<%= b.id %>"><%= b.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<select class="col-12 form-select" id="report_compare" name="report_compare[]" multiple>
|
||||
<div class="col-12 mb-3">
|
||||
<select id="report_compare" class="col-12 form-select" name="report_compare[]" multiple>
|
||||
<% tests.each do |t| %>
|
||||
<option value="<%= t.id %>"><%= t.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mb-3">
|
||||
<input type="submit" class="btn btn-primary" id="generate_button" value="Generate">
|
||||
<a href="#" class="button" id="download_button" disabled>Download</a>
|
||||
<a href="#" class="btn btn-primary" id="download_button" disabled>Download</a>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="col-12">
|
||||
<canvas id="chart_canvas" width="100%" height="25"></canvas>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,64 +1,56 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1><%= test.name %></h1>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p><a href="/test/<%= test.id %>/edit">Edit</a></p>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
Hardware tested: <%= test.hardware.name %>
|
||||
<div class="col-12">
|
||||
<p>Hardware tested: <%= test.hardware.name %></p>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p><%= test.description %></p>
|
||||
</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">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<form action="/result/add" method="post">
|
||||
<input type="hidden" name="result_test" value="<%= test.id %>">
|
||||
<input type="hidden" name="result_referrer" value="test">
|
||||
|
||||
<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">
|
||||
<% test.benchmark.each do |b| %>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-5 mb-3 mb-md-0">
|
||||
<label for="result_benchmark">Add benchmark result:</label>
|
||||
<select class="form-select" id="result_benchmark" name="result_benchmark">
|
||||
<% test.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 class="col-4 col-md-2">
|
||||
<label for="result_average">Average score:</label>
|
||||
<input id="result_average" class="form-control" type="text" name="result_average" value="">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-2">
|
||||
<label for="result_minimum">
|
||||
Minimum score:
|
||||
<input type="text" id="result_minimum" name="result_minimum" value="">
|
||||
</label>
|
||||
<div class="col-4 col-md-2">
|
||||
<label for="result_minimum">Minimum score:</label>
|
||||
<input id="result_minimum" class="form-control" type="text" name="result_minimum" value="">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-2">
|
||||
<label for="result_maximum">
|
||||
Maximum score:
|
||||
<input type="text" id="result_maximum" name="result_maximum" value="">
|
||||
</label>
|
||||
<div class="col-4 col-md-2 mb-3 mb-md-0">
|
||||
<label for="result_maximum">Maximum score:</label>
|
||||
<input id="result_maximum" class="form-control" type="text" name="result_maximum" value="">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-1">
|
||||
<input type="submit" class="u-full-width button" value="Submit">
|
||||
<div class="col-12 col-md-1 d-flex align-items-stretch mb-3 mb-md-0">
|
||||
<input class="btn btn-primary w-100" type="submit" value="Submit">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -67,8 +59,8 @@
|
||||
|
||||
<h4>Benchmark results for this test:</h4>
|
||||
|
||||
<table id="results-table" data-test-id="<%= test.id %>">
|
||||
<thead>
|
||||
<table id="results-table" class="table table-hover table-responsive" data-test-id="<%= test.id %>">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Benchmark name</th>
|
||||
<th>Scoring type</th>
|
||||
@ -79,7 +71,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% test.benchmark.each do |benchmark| %>
|
||||
<% test.benchmarks.each do |benchmark| %>
|
||||
<tr data-benchmark-id="<%= benchmark.id %>"></tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
Reference in New Issue
Block a user