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