Compare commits
22 Commits
31b8404be1
...
main
Author | SHA1 | Date | |
---|---|---|---|
bc5ae4962f | |||
ec2bf45a6e | |||
57163b10e4 | |||
25d394627d | |||
85dfdb163a | |||
b593ef7593 | |||
26698082f4 | |||
42a0b95015 | |||
5cc3b8f824 | |||
d59c75281e | |||
55e4f397f8 | |||
49d1276031 | |||
bc70fb8dd0 | |||
0231ebad2d | |||
541b5236f0 | |||
6215cecb53 | |||
886f566ae2 | |||
fdd350e16f | |||
bc4cb181c3 | |||
822f49bcc2 | |||
aec77628f7 | |||
ecb696372d |
@ -1,6 +1,6 @@
|
||||
pipeline:
|
||||
style:
|
||||
image: ruby:3.0
|
||||
image: ruby:3.4
|
||||
commands:
|
||||
- 'gem install rake'
|
||||
- 'bundle config set --local path "vendor/bundle"'
|
||||
|
@ -2,7 +2,7 @@ FROM ruby:3.4
|
||||
|
||||
RUN gem install bundler
|
||||
|
||||
WORKDIR /src
|
||||
WORKDIR /usr/src/game-data
|
||||
|
||||
COPY Gemfile Gemfile.l*ck ./
|
||||
|
||||
@ -13,3 +13,4 @@ RUN gem install rake
|
||||
COPY . ./
|
||||
|
||||
ENTRYPOINT ["bash", "entrypoints/dev.sh"]
|
||||
|
||||
|
13
Dockerfile.gulp
Normal file
13
Dockerfile.gulp
Normal file
@ -0,0 +1,13 @@
|
||||
# Node.js runtime
|
||||
FROM node:24
|
||||
|
||||
WORKDIR /usr/src/game-data/
|
||||
|
||||
COPY package.* /usr/src/game-data/
|
||||
|
||||
RUN npm install
|
||||
|
||||
VOLUME /usr/src/game-data/node_modules/
|
||||
|
||||
# Run the app
|
||||
CMD [ "npm", "run", "gulp" ]
|
@ -1,3 +1,3 @@
|
||||
$ ->
|
||||
# run foundation scripts
|
||||
$(document).foundation()
|
||||
console.log('Ready.')
|
||||
|
@ -1,54 +1,116 @@
|
||||
$(document).ready ->
|
||||
$('#generate_button').on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
$.ajax(
|
||||
method: 'POST'
|
||||
url: '/reports'
|
||||
data:
|
||||
type: $('#report_type').val()
|
||||
choice: $('#report_choice').val()
|
||||
compare: $('#report_compare').val()).done (data) ->
|
||||
benchChart.options.title.text = data.choice
|
||||
benchChart.data.labels = data.names
|
||||
benchChart.data.datasets[0].data = data.avg_results
|
||||
benchChart.data.datasets[1].data = data.min_results
|
||||
benchChart.update()
|
||||
return
|
||||
return
|
||||
return
|
||||
$ ->
|
||||
chartInstance = null
|
||||
|
||||
benchChart = new Chart(document.getElementById('chart_canvas').getContext('2d'),
|
||||
type: 'horizontalBar'
|
||||
data:
|
||||
labels: []
|
||||
datasets: [
|
||||
{
|
||||
label: 'Average FPS'
|
||||
data: []
|
||||
backgroundColor: 'hotpink'
|
||||
borderColor: '#212121'
|
||||
borderWidth: 1
|
||||
}
|
||||
{
|
||||
label: 'Minimum FPS'
|
||||
data: []
|
||||
backgroundColor: 'cornflowerblue'
|
||||
borderColor: '#212121'
|
||||
borderWidth: 1
|
||||
}
|
||||
]
|
||||
options:
|
||||
title:
|
||||
display: true
|
||||
text: 'N/a'
|
||||
scales: xAxes: [ {
|
||||
display: true
|
||||
ticks: beginAtZero: true
|
||||
} ]
|
||||
animation: onComplete: ->
|
||||
dwnbtn = $('#download_button')
|
||||
dwnbtn.attr 'href', benchChart.toBase64Image()
|
||||
dwnbtn.attr 'download', 'benchmark_chart.png'
|
||||
dwnbtn.attr 'disabled', false
|
||||
return
|
||||
)
|
||||
$('#report-benchmarks').on 'change', (e) ->
|
||||
$('#report-tests option').prop('selected', false)
|
||||
|
||||
$('#reports-download').on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
canvas = $('#benchmark-chart')[0]
|
||||
a = document.createElement 'a'
|
||||
a.href = canvas.toDataURL 'image/png'
|
||||
a.download = 'chart.png'
|
||||
a.click()
|
||||
|
||||
$('#reports-button').on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
$('#reports-download').attr('disabled', true)
|
||||
chartInstance.destroy() if chartInstance
|
||||
|
||||
benchmarkId = $('#report-benchmarks').val()
|
||||
testIds = $('#report-tests').val()
|
||||
|
||||
benchmarkSearchParams = new URLSearchParams
|
||||
benchmark_id: benchmarkId
|
||||
benchmarkRes = await fetch("/api/v1/benchmark/details?#{benchmarkSearchParams}")
|
||||
benchmarkData = await benchmarkRes.json()
|
||||
|
||||
data =
|
||||
labels: []
|
||||
datasets: []
|
||||
|
||||
switch benchmarkData.scoring
|
||||
when 'pts'
|
||||
data.datasets.push({
|
||||
label: 'Average Score'
|
||||
data: []
|
||||
})
|
||||
when 'fps'
|
||||
data.datasets.push({
|
||||
label: 'Average FPS'
|
||||
data: []
|
||||
})
|
||||
data.datasets.push({
|
||||
label: 'Minimum FPS'
|
||||
data: []
|
||||
})
|
||||
when 'ms'
|
||||
data.datasets.push({
|
||||
label: 'Average Frame Time'
|
||||
data: []
|
||||
})
|
||||
data.datasets.push({
|
||||
label: 'Minimum Frame Time'
|
||||
data: []
|
||||
})
|
||||
|
||||
for testId in testIds
|
||||
try
|
||||
testSearchParams = new URLSearchParams
|
||||
test_id: testId
|
||||
testRes = await fetch("/api/v1/test/details?#{testSearchParams}")
|
||||
testData = await testRes.json()
|
||||
|
||||
resultSearchParams = new URLSearchParams
|
||||
test_id: testId
|
||||
benchmark_id: benchmarkId
|
||||
resultRes = await fetch("/api/v1/result/list?#{resultSearchParams}")
|
||||
resultData = await resultRes.json()
|
||||
|
||||
avg_total = 0
|
||||
min_total = 0
|
||||
max_total = 0
|
||||
|
||||
for result in resultData
|
||||
avg_total += result.avg_score
|
||||
min_total += result.min_score if result.min_score
|
||||
max_total += result.max_score if result.max_score
|
||||
|
||||
data.labels.push(testData.name)
|
||||
data.datasets[0].data.push(avg_total / resultData.length)
|
||||
console.log(data.datasets[0].data)
|
||||
switch benchmarkData.scoring
|
||||
when 'fps', 'ms'
|
||||
data.datasets[1].data.push(min_total / resultData.length)
|
||||
catch error
|
||||
console.error 'An error occurred while fetching benchmark results.', error
|
||||
|
||||
ctx = $('#benchmark-chart')[0].getContext('2d')
|
||||
|
||||
options =
|
||||
indexAxis: 'y'
|
||||
plugins:
|
||||
title:
|
||||
display: true
|
||||
text: benchmarkData.name
|
||||
font:
|
||||
size: '24'
|
||||
datalabels:
|
||||
anchor: 'end'
|
||||
align: 'left'
|
||||
color: 'black'
|
||||
font:
|
||||
weight: 'bold'
|
||||
formatter: (value) -> value
|
||||
scales:
|
||||
y:
|
||||
beginAtZero: true
|
||||
|
||||
chartInstance = new Chart ctx,
|
||||
type: 'bar'
|
||||
data: data
|
||||
options: options
|
||||
plugins: [ChartDataLabels]
|
||||
|
||||
$('#reports-download').attr('disabled', false)
|
||||
$('#benchmark-chart').removeClass('disabled')
|
||||
|
@ -10,7 +10,7 @@ fetchTestBenchmarkResults = (testId, benchmarkId) ->
|
||||
resultSearchParams = new URLSearchParams
|
||||
test_id: testId
|
||||
benchmark_id: benchmarkId
|
||||
resultRes = await fetch("/api/v1/results?#{resultSearchParams}")
|
||||
resultRes = await fetch("/api/v1/result/list?#{resultSearchParams}")
|
||||
resultData = await resultRes.json()
|
||||
|
||||
avg_total = 0
|
||||
@ -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>')
|
||||
|
||||
|
@ -1,10 +1,21 @@
|
||||
#main-nav
|
||||
margin-bottom: 15px
|
||||
@use "sass:color"
|
||||
|
||||
h1.invalid
|
||||
color: red
|
||||
//$primary-color: #3399ff
|
||||
$primary-color: cornflowerblue
|
||||
$primary-color-highlight: color.adjust($primary-color, $lightness: -10%)
|
||||
|
||||
.button
|
||||
position: relative
|
||||
top: -25%
|
||||
margin-top: 50%
|
||||
html
|
||||
width: 100%
|
||||
height: 100%
|
||||
|
||||
body
|
||||
background: rgb(240, 235, 248)
|
||||
|
||||
table
|
||||
border: 1px solid #666
|
||||
|
||||
#wrapper
|
||||
background: white
|
||||
padding: 1.5rem 2rem
|
||||
border: 1px solid #bbb
|
||||
border-radius: 8px
|
||||
|
@ -1 +1,2 @@
|
||||
docker build -t game-data -f Dockerfile.dev .
|
||||
docker build -t game-data-gulp -f Dockerfile.gulp .
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
docker build -t game-data -f Dockerfile.dev .
|
||||
docker build -t game-data-gulp -f Dockerfile.gulp .
|
||||
|
||||
|
@ -1 +1,2 @@
|
||||
docker run --rm -d -t -v "%cd%:/src" -p 9292:9292 --name game-data game-data
|
||||
docker run --rm -d -t -v "%cd%:/usr/src/game-data" -p 9292:9292 --name game-data game-data
|
||||
docker run --rm -d -t -v "%cd%:/usr/src/game-data" --name game-data-gulp game-data-gulp npm run gulp watch
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
docker run --rm -d -t -v "$(pwd):/src" -p 9292:9292 --name game-data game-data
|
||||
docker run --rm -d -t -v "$(pwd):/usr/src/game-data" -p 9292:9292 --name game-data game-data
|
||||
docker run --rm -d -t -v "$(pwd):/usr/src/game-data" --name game-data-gulp game-data-gulp npm run gulp watch
|
||||
|
||||
|
9
config/puma.rb
Normal file
9
config/puma.rb
Normal file
@ -0,0 +1,9 @@
|
||||
app_dir = File.expand_path('..', __dir__)
|
||||
directory app_dir
|
||||
|
||||
environment ENV.fetch('RACK_ENV', 'development')
|
||||
|
||||
bind 'tcp://0.0.0.0:9292'
|
||||
workers 2
|
||||
threads 1, 5
|
||||
|
29
gulpfile.js
29
gulpfile.js
@ -14,26 +14,37 @@ function compileSass() {
|
||||
|
||||
// Compile .coffee files to JavaScript with source maps
|
||||
function compileCoffee() {
|
||||
return gulp.src('assets/scripts/*.coffee', { sourcemaps: true })
|
||||
return gulp.src('assets/scripts/**/*.coffee', { sourcemaps: true })
|
||||
.pipe(plumber())
|
||||
.pipe(coffee({ bare: true }))
|
||||
.pipe(gulp.dest('public/js', { sourcemaps: '.' }));
|
||||
}
|
||||
|
||||
// Watch files for changes
|
||||
function watchFiles() {
|
||||
function watchFiles(cb) {
|
||||
gulp.watch('assets/styles/**/*.sass', compileSass);
|
||||
gulp.watch('assets/scripts/**/*.coffee', compileCoffee);
|
||||
cb();
|
||||
}
|
||||
|
||||
// Define default task
|
||||
exports.default = gulp.series(
|
||||
gulp.parallel(compileSass, compileCoffee),
|
||||
watchFiles
|
||||
);
|
||||
// Chain all asset builds together
|
||||
function buildAssets() {
|
||||
return gulp.parallel(compileSass, compileCoffee);
|
||||
}
|
||||
|
||||
// Perform initial build then watch
|
||||
function buildAndWatch() {
|
||||
return gulp.series(
|
||||
buildAssets(),
|
||||
watchFiles
|
||||
);
|
||||
}
|
||||
|
||||
// one-time build
|
||||
exports.build = gulp.parallel(compileSass, compileCoffee);
|
||||
exports.build = buildAssets();
|
||||
|
||||
// start builds with file watching
|
||||
exports.watch = watchFiles;
|
||||
exports.watch = buildAndWatch();
|
||||
|
||||
// Define default task (defaults to watch)
|
||||
exports.default = exports.watch;
|
||||
|
7
src/appinfo.rb
Normal file
7
src/appinfo.rb
Normal file
@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AppInfo
|
||||
|
||||
VERSION = '0.1.1'
|
||||
|
||||
end
|
@ -3,6 +3,14 @@
|
||||
# Helpers - view helper functions
|
||||
module Helpers
|
||||
|
||||
def ruby_version
|
||||
return RUBY_VERSION
|
||||
end
|
||||
|
||||
def app_version
|
||||
return AppInfo::VERSION
|
||||
end
|
||||
|
||||
def date_format(date)
|
||||
dt = date.to_datetime
|
||||
return dt.strftime('%B %d, %Y @ %I:%M:%S %p %Z')
|
||||
|
@ -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,10 @@ class Test < Sequel::Model
|
||||
|
||||
one_to_many :result
|
||||
many_to_one :hardware
|
||||
many_to_many :benchmark
|
||||
many_to_many :benchmarks
|
||||
|
||||
def has_benchmark(benchmark_id)
|
||||
return benchmarks_dataset.where(Sequel[:benchmarks][:id] => benchmark_id).any?
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -11,7 +11,7 @@ class GameData < Sinatra::Base
|
||||
json benchmark.values()
|
||||
end
|
||||
|
||||
get '/api/v1/results' do
|
||||
get '/api/v1/result/list' do
|
||||
test_id = params[:test_id]
|
||||
benchmark_id = params[:benchmark_id]
|
||||
|
||||
@ -20,4 +20,12 @@ class GameData < Sinatra::Base
|
||||
json results.map(&:values)
|
||||
end
|
||||
|
||||
get '/api/v1/test/details' do
|
||||
test_id = params[:test_id]
|
||||
|
||||
tst = Test.where(id: test_id).first()
|
||||
|
||||
json tst.values()
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -4,11 +4,11 @@
|
||||
class GameData < Sinatra::Base
|
||||
|
||||
get '/' do
|
||||
results = Result.reverse(:updated_at).limit(10).all()
|
||||
tests = Test.reverse(:updated_at).limit(10).all()
|
||||
|
||||
erb :'index/index', locals: {
|
||||
title: 'Dashboard',
|
||||
results: results
|
||||
tests: tests
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
require_relative 'index'
|
||||
require_relative 'hardware'
|
||||
require_relative 'benchmark'
|
||||
require_relative 'result'
|
||||
require_relative 'reports'
|
||||
require_relative 'result'
|
||||
require_relative 'test'
|
||||
|
||||
require_relative 'api1'
|
||||
|
@ -3,18 +3,18 @@
|
||||
# /reports routes
|
||||
class GameData < Sinatra::Base
|
||||
|
||||
get '/reports' do
|
||||
get '/report' do
|
||||
benchmarks = Benchmark.order(:name).all()
|
||||
hardware = Hardware.order(:name).all()
|
||||
tests = Test.order(:name).all()
|
||||
|
||||
erb :'reports/index', locals: {
|
||||
title: 'Generate Reports',
|
||||
hardware: hardware,
|
||||
tests: tests,
|
||||
benchmarks: benchmarks
|
||||
}
|
||||
end
|
||||
|
||||
post '/reports' do
|
||||
post '/report' do
|
||||
report_type = params[:type]
|
||||
report_choice = params[:choice]
|
||||
report_compare = params[:compare]
|
||||
@ -26,10 +26,10 @@ class GameData < Sinatra::Base
|
||||
min_results = []
|
||||
|
||||
report_compare.each do |c|
|
||||
hrd = Hardware.where(id: c).first()
|
||||
names.push(hrd.name)
|
||||
tst = Test.where(id: c).first()
|
||||
names.push(tst.name)
|
||||
|
||||
res = Result.where(benchmark_id: report_choice, hardware_id: c).first()
|
||||
res = Result.where(benchmark_id: report_choice, test_id: c).first()
|
||||
avg_results.push(res.avg_score)
|
||||
min_results.push(res.min_score)
|
||||
end
|
||||
|
@ -3,25 +3,6 @@
|
||||
# /result routes
|
||||
class GameData < Sinatra::Base
|
||||
|
||||
get '/result' do
|
||||
results = Result.reverse(:updated_at).limit(10).all()
|
||||
|
||||
erb :'result/index', locals: {
|
||||
title: 'List of Results',
|
||||
results: results
|
||||
}
|
||||
end
|
||||
|
||||
get '/result/add' do
|
||||
hardware = Hardware.all()
|
||||
benchmarks = Benchmark.all()
|
||||
|
||||
erb :'result/add', locals: {
|
||||
title: 'Add Result',
|
||||
hardware: hardware,
|
||||
benchmarks: benchmarks
|
||||
}
|
||||
end
|
||||
post '/result/add' do
|
||||
result_minimum = params[:result_minimum] if params.key?(:result_minimum)
|
||||
result_maximum = params[:result_maximum] if params.key?(:result_maximum)
|
||||
|
@ -15,6 +15,7 @@ class GameData < Sinatra::Base
|
||||
get '/test/add' do
|
||||
hardware = Hardware.order(:name).all()
|
||||
benchmarks = Benchmark.order(:name).all()
|
||||
|
||||
erb :'test/add', locals: {
|
||||
title: 'Add Test',
|
||||
hardware: hardware,
|
||||
@ -46,23 +47,44 @@ class GameData < Sinatra::Base
|
||||
}
|
||||
end
|
||||
|
||||
get '/test/:hardware_id/edit' do
|
||||
hardware = Hardware.where(id: params[:hardware_id]).first()
|
||||
get '/test/:test_id/edit' do
|
||||
tst = Test.where(id: params[:test_id]).first()
|
||||
hardware = Hardware.order(:name).all()
|
||||
benchmarks = Benchmark.order(:name).all()
|
||||
|
||||
erb :'test/edit', locals: {
|
||||
title: "Editing: #{hardware.name}",
|
||||
hardware: hardware
|
||||
title: "Editing: #{tst.name}",
|
||||
test: tst,
|
||||
hardware: hardware,
|
||||
benchmarks: benchmarks
|
||||
}
|
||||
end
|
||||
|
||||
post '/test/:hardware_id/edit' do
|
||||
hardware = Hardware.where(id: params[:hardware_id]).first()
|
||||
post '/test/:test_id/edit' do
|
||||
tst = Test.where(id: params[:test_id]).first()
|
||||
|
||||
hardware.update(
|
||||
name: params[:hardware_name],
|
||||
type: params[:hardware_type]
|
||||
tst.update(
|
||||
name: params[:test_name],
|
||||
hardware_id: params[:test_hardware],
|
||||
description: params[:test_description]
|
||||
)
|
||||
|
||||
redirect "/hardware/#{hardware.id}"
|
||||
# create an array of the selected benchmarks
|
||||
selected_benchmarks = Array(params[:test_benchmarks])
|
||||
# remove benchmarks no longer associated with the test
|
||||
tst.benchmarks.each do |b|
|
||||
if not selected_benchmarks.include?(b)
|
||||
tst.remove_benchmark(b)
|
||||
end
|
||||
end
|
||||
# associate the benchmarks to the test
|
||||
selected_benchmarks.each do |b|
|
||||
if not tst.has_benchmark(b)
|
||||
tst.add_benchmark(b)
|
||||
end
|
||||
end
|
||||
|
||||
redirect "/test/#{tst.id}"
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -5,6 +5,8 @@ require 'sinatra/json'
|
||||
require 'sequel'
|
||||
require 'sqlite3'
|
||||
|
||||
require_relative 'appinfo'
|
||||
|
||||
# Load the Sequel timestamps plugin
|
||||
Sequel::Model.plugin(:timestamps)
|
||||
# Initialize Sequel gem for database actions
|
||||
|
@ -1,41 +1,38 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
<h1>Add new benchmark</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row">
|
||||
|
||||
<form class="cell small-12" action="/benchmark/add" method="post">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-9">
|
||||
<label>
|
||||
Benchmark name
|
||||
<input type="text" name="benchmark_name" placeholder="Example benchmark">
|
||||
</label>
|
||||
<form class="col-12" action="/benchmark/add" method="post">
|
||||
<div class="row mb-3">
|
||||
<div class="col-9">
|
||||
<label for="benchmark_name">Benchmark name</label>
|
||||
<input id="benchmark_name" class="form-control" type="text" name="benchmark_name" placeholder="Example benchmark">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-3">
|
||||
<label>
|
||||
Scoring type
|
||||
<select name="benchmark_scoring">
|
||||
<option value="fps">Frames per Second (fps)</option>
|
||||
<option value="ms">Frame Time (ms)</option>
|
||||
<option value="pts">Total Points</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="col-3">
|
||||
<label for="benchmark_scoring">Scoring type</label>
|
||||
<select id="benchmark_scoring" class="form-select" name="benchmark_scoring">
|
||||
<option value="fps">Frames per Second (fps)</option>
|
||||
<option value="ms">Frame Time (ms)</option>
|
||||
<option value="pts">Total Points</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell small-12">
|
||||
<textarea name="benchmark_description" class="cell small-12">Enter a description/notes here.</textarea>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<label for="benchmark_description">Benchmark description</label>
|
||||
<textarea id="benchmark_description" class="form-control" name="benchmark_description" placeholder="Enter a description/notes here."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell small-12">
|
||||
<input type="submit" class="button" value="Submit">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input class="btn btn-primary w-100" type="submit" value="Create Benchmark">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,41 +1,38 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
<h1>Editing: <%= benchmark.name %></h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row">
|
||||
|
||||
<form class="cell small-12" action="/benchmark/<%= benchmark.id %>/edit" method="post">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-9">
|
||||
<label>
|
||||
Benchmark name
|
||||
<input type="text" name="benchmark_name" placeholder="Example benchmark" value="<%= benchmark.name %>">
|
||||
</label>
|
||||
<div class="row mb-3">
|
||||
<div class="col-9">
|
||||
<label for="benchmark_name">Benchmark name</label>
|
||||
<input id="benchmark_name" class="form-control" type="text" name="benchmark_name" placeholder="Example benchmark" value="<%= benchmark.name %>">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-3">
|
||||
<label>
|
||||
Scoring type
|
||||
<select name="benchmark_scoring">
|
||||
<option value="fps" <% if benchmark.scoring == 'fps' %>selected<% end %>>Frames per Second (fps)</option>
|
||||
<option value="ms" <% if benchmark.scoring == 'ms' %>selected<% end %>>Frame Time (ms)</option>
|
||||
<option value="pts" <% if benchmark.scoring == 'pts' %>selected<% end %>>Total Points</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="col-3">
|
||||
<label for="benchmark_scoring">Scoring type</label>
|
||||
<select id="benchmark_scoring" class="form-select" name="benchmark_scoring">
|
||||
<option value="fps" <% if benchmark.scoring == 'fps' %>selected<% end %>>Frames per Second (fps)</option>
|
||||
<option value="ms" <% if benchmark.scoring == 'ms' %>selected<% end %>>Frame Time (ms)</option>
|
||||
<option value="pts" <% if benchmark.scoring == 'pts' %>selected<% end %>>Total Points</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell small-12">
|
||||
<textarea name="benchmark_description" class="cell small-12"><%= benchmark.description %></textarea>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<label for="benchmark_description">Benchmark description</label>
|
||||
<textarea id="benchmark_description" class="form-control" name="benchmark_description" placeholder="Enter a description/notes here."><%= benchmark.description %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell small-12">
|
||||
<input type="submit" class="button" value="Submit">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input class="btn btn-primary w-100" type="submit" value="Submit Changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,20 +1,20 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h1>List of benchmarks</h1>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p>
|
||||
<a href="/benchmark/add">Add new benchmark</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row">
|
||||
<% if benchmarks.length > 0 %>
|
||||
<div class="cell small-12">
|
||||
<table>
|
||||
<thead>
|
||||
<div class="col-12">
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Benchmark name</th>
|
||||
<th>Scoring type</th>
|
||||
@ -24,7 +24,7 @@
|
||||
<tbody>
|
||||
<% benchmarks.each do |b| %>
|
||||
<tr>
|
||||
<td><a href="/benchmark/<%= b.id %>"><%= b.name %></a</td>
|
||||
<td><a href="/benchmark/<%= b.id %>"><%= b.name %></a></td>
|
||||
<td><%= b.scoring %></td>
|
||||
<td><%= b.description %></td>
|
||||
</tr>
|
||||
@ -33,7 +33,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p>I'm sorry, there doesn't appear to be any benchmarks added yet. Check again later!</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -1,18 +1,49 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1><%= benchmark.name %></h1>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p><a href="/benchmark/<%= benchmark.id %>/edit">Edit</a></p>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
Benchmark scoring type: <%= benchmark.scoring %>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
Description:
|
||||
<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>
|
||||
|
@ -1,32 +1,32 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h1>Add new hardware</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row mb-3">
|
||||
|
||||
<form class="cell small-12" action="/hardware/add" method="post">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-9">
|
||||
<label>
|
||||
Hardware name
|
||||
<input type="text" name="hardware_name" placeholder="Example hardware">
|
||||
</label>
|
||||
<form class="col-12" action="/hardware/add" method="post">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 col-md-9">
|
||||
<label for="hardware_name">Hardware name</label>
|
||||
<input id="hardware_name" class="form-control" type="text" name="hardware_name" placeholder="Example hardware">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-3">
|
||||
<label>
|
||||
Type
|
||||
<select name="hardware_type">
|
||||
<option value="gpu">Graphics card</option>
|
||||
<option value="cpu">Processor</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="col-12 col-md-3">
|
||||
<label for="hardware_type">Type</label>
|
||||
<select id="hardware_type" class="form-select" name="hardware_type">
|
||||
<option value="gpu">Graphics card</option>
|
||||
<option value="cpu">Processor</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="button" value="Submit">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input class="btn btn-primary w-100" type="submit" value="Create Hardware">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -1,32 +1,32 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<h1>Editing: <%= hardware.name %></h1>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h1>Add new hardware</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row mb-3">
|
||||
|
||||
<form class="cell small-12" action="/hardware/<%= hardware.id %>/edit" method="post">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-9">
|
||||
<label>
|
||||
Hardware name
|
||||
<input type="text" name="hardware_name" placeholder="Example hardware" value="<%= hardware.name %>">
|
||||
</label>
|
||||
<form class="col-12" action="/hardware/<%= hardware.id %>/edit" method="post">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12 col-md-9">
|
||||
<label for="hardware_name">Hardware name</label>
|
||||
<input id="hardware_name" class="form-control" type="text" name="hardware_name" placeholder="Example hardware" value="<%= hardware.name %>">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-3">
|
||||
<label>
|
||||
Type
|
||||
<select name="hardware_type">
|
||||
<option value="gpu" <% if hardware.type == 'gpu' %>selected<% end %>>Graphics card</option>
|
||||
<div class="col-12 col-md-3">
|
||||
<label for="hardware_type">Type</label>
|
||||
<select id="hardware_type" class="form-select" name="hardware_type">
|
||||
<option value="gpu" <% if hardware.type == 'gpu' %>selected<% end %>>Graphics card</option>
|
||||
<option value="cpu" <% if hardware.type == 'cpu' %>selected<% end %>>Processor</option>
|
||||
</select>
|
||||
</label>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="button" value="Submit">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input class="btn btn-primary w-100" type="submit" value="Submit Changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -1,20 +1,20 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h1>List of hardware</h1>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p>
|
||||
<a href="/hardware/add">Add new hardware</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row mb-3">
|
||||
<% if hardware.length > 0 %>
|
||||
<div class="cell small-12">
|
||||
<table>
|
||||
<thead>
|
||||
<div class="col-12">
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Hardware name</th>
|
||||
<th>Type</th>
|
||||
@ -35,7 +35,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p>I'm sorry, there doesn't appear to be any hardware added yet. Check again later!</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -1,13 +1,44 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h1><%= hardware.name %></h1>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p><a href="/hardware/<%= hardware.id %>/edit">Edit</a></p>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
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,30 +1,31 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<% if results.length > 0 %>
|
||||
<div class="cell small-12">
|
||||
<div class="row">
|
||||
<% if tests.length > 0 %>
|
||||
<div class="12-col mb-3">
|
||||
<h2>Latest benchmark results:</h2>
|
||||
</div>
|
||||
<div class="cell small-12">
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
<div class="12-col">
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Hardware tested</th>
|
||||
<th>Benchmark used</th>
|
||||
<th>Score</th>
|
||||
<th>Test name</th>
|
||||
<th># Benchmarks</th>
|
||||
<th>Last Updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% results.each do |r| %>
|
||||
<% tests.each do |t| %>
|
||||
<tr>
|
||||
<td><%= r.hardware.name %></td>
|
||||
<td><%= r.benchmark.name %></td>
|
||||
<td><%= r.formatted_score() %></td>
|
||||
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
||||
<td><%= t.benchmarks.length %></td>
|
||||
<td><%= t.updated_at %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="cell small-12">
|
||||
<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 %>
|
||||
|
@ -5,20 +5,24 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title><%= title %> | Game Data</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/css/foundation.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.7/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/rimmington.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.5/js/foundation.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.7/js/bootstrap.min.js" charset="utf-8"></script>
|
||||
<script src="/js/edgeville.js" charset="utf-8"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js" charset="utf-8"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body class="d-flex flex-column min-vh-100">
|
||||
<!-- main navigation -->
|
||||
<%= erb :'partials/navbar', :locals => locals %>
|
||||
|
||||
<!-- main content -->
|
||||
<div class="grid-container">
|
||||
<%= yield %>
|
||||
</div>
|
||||
<main class="flex-grow-1 py-4">
|
||||
<div id="wrapper" class="container mb-4">
|
||||
<%= yield %>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- site footer -->
|
||||
<%= erb :'partials/footer', :locals => locals %>
|
||||
</body>
|
||||
</html>
|
||||
|
10
views/partials/footer.erb
Normal file
10
views/partials/footer.erb
Normal file
@ -0,0 +1,10 @@
|
||||
<footer id="main-footer" class="bg-light border-top py-3 text-center">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p>Game Data version v<%= app_version() %></p>
|
||||
<p class="mb-0">Running Ruby version v<%= ruby_version() %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
@ -1,11 +1,29 @@
|
||||
<div id="main-nav" class="top-bar">
|
||||
<div class="top-bar-left">
|
||||
<ul class="menu">
|
||||
<li><a href="/">Dashboard</a></li>
|
||||
<li><a href="/hardware">Hardware</a></li>
|
||||
<li><a href="/benchmark">Benchmarks</a></li>
|
||||
<li><a href="/test">Tests</a></li>
|
||||
<li><a href="/reports">Reports</a></li>
|
||||
</ul>
|
||||
<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>
|
||||
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/">Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/benchmark">Benchmarks</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/hardware">Hardware</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/test">Test</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/report">Reports</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,35 +1,43 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<form class="cell small-12" action="/reports" method="post">
|
||||
<div class="grid-x grid-margin-x">
|
||||
<select class="cell medium-6" id="report_type" name="report_type" disabled>
|
||||
<option value="benchmark">Benchmark</option>
|
||||
<option value="hardware">Hardware</option>
|
||||
</select>
|
||||
<div class="row">
|
||||
<form class="col-12" action="/reports" method="post">
|
||||
<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="cell medium-6" id="report_choice" name="report_choice">
|
||||
<% benchmarks.each do |b| %>
|
||||
<option value="<%= b.id %>"><%= b.name %></option>
|
||||
<div class="col-12 col-md-6">
|
||||
<select id="report-benchmarks" class="form-select" name="report_choice">
|
||||
<% benchmarks.each do |b| %>
|
||||
<option value="<%= b.id %>"><%= b.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mb-3">
|
||||
<select id="report-tests" 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="grid-x grid-margin-x">
|
||||
<select class="cell small-12" id="report_compare" name="report_compare[]" multiple>
|
||||
<% hardware.each do |h| %>
|
||||
<option value="<%= h.id %>"><%= h.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<div class="col-12 mb-3">
|
||||
<button id="reports-button" class="btn btn-primary">Generate</button>
|
||||
<button id="reports-download" class="btn btn-primary" disabled>Download</button>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="button" id="generate_button" value="Generate">
|
||||
<a href="#" class="button" id="download_button" disabled>Download</a>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<canvas id="chart_canvas" width="100%" height="25"></canvas>
|
||||
<div class="col-12">
|
||||
<canvas id="benchmark-chart" width="100%" height="25"></canvas>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- load the chart.js library -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js" charset="utf-8"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.2.0/chartjs-plugin-datalabels.min.js" charset="utf-8"></script>
|
||||
<!-- load chart functionality -->
|
||||
<script src="/js/reports.js" charset="utf-8"></script>
|
||||
|
@ -1,60 +0,0 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<h1>Add new result</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
|
||||
<form class="cell small-12" action="/result/add" method="post">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-6">
|
||||
<label>
|
||||
Hardware:
|
||||
<select name="result_hardware">
|
||||
<% hardware.each do |h| %>
|
||||
<option value="<%= h.id %>"><%= h.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="cell medium-6">
|
||||
<label>
|
||||
Benchmark:
|
||||
<select name="result_benchmark">
|
||||
<% benchmarks.each do |b| %>
|
||||
<option value="<%= b.id %>"><%= b.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-4">
|
||||
<label>
|
||||
Average score:
|
||||
<input type="number" name="result_average" value="0.0" step="0.01" required>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="cell medium-4">
|
||||
<label>
|
||||
Minimum score:
|
||||
<input type="number" name="result_minimum" value="0.0" step="0.01">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="cell medium-4">
|
||||
<label>
|
||||
Maximum score:
|
||||
<input type="number" name="result_maximum" value="0.0" step="0.01">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="button" value="Submit">
|
||||
</form>
|
||||
|
||||
</div>
|
@ -1,44 +0,0 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<h1>List of results</h1>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<p>
|
||||
<a href="/result/add">Add new result</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<% if results.length > 0 %>
|
||||
<div class="cell small-12">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hardware</th>
|
||||
<th>Benchmark</th>
|
||||
<th>Score (type)</th>
|
||||
<th>Date added</th>
|
||||
<th>Date modified</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% results.each do |r| %>
|
||||
<tr>
|
||||
<td><%= r.hardware.name %></td>
|
||||
<td><%= r.benchmark.name %></td>
|
||||
<td><%= r.score %> (<%= r.benchmark.scoring %>)</td>
|
||||
<td><%= date_format(r.created_at) %></td>
|
||||
<td><%= date_format(r.updated_at) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="cell small-12">
|
||||
<p>I'm sorry, there don't appear to be any results added yet. Check again later!</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
@ -1,50 +1,49 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h1>Add new test</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row">
|
||||
|
||||
<form class="cell small-12" action="/test/add" method="post">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-6">
|
||||
<label>
|
||||
Test name
|
||||
<input type="text" name="test_name" placeholder="My hardware test (01/99)">
|
||||
</label>
|
||||
<form class="col-12" action="/test/add" method="post">
|
||||
<div class="row mb-0 mb-md-3">
|
||||
<div class="col-12 col-md-6 mb-3 mb-md-0">
|
||||
<label for="test_name">Test name</label>
|
||||
<input id="test_name" class="form-control" type="text" name="test_name" placeholder="My hardware test (01/99)">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-6">
|
||||
<label>
|
||||
Type
|
||||
<select name="test_hardware">
|
||||
<% for h in hardware %>
|
||||
<option value="<%= h.id %>"><%= h.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</label>
|
||||
<div class="col-12 col-md-6 mb-3 mb-md-0">
|
||||
<label for="test_hardware">Hardware to test</label>
|
||||
<select id="test_hardware" class="form-select" name="test_hardware">
|
||||
<% for h in hardware %>
|
||||
<option value="<%= h.id %>"><%= h.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="cell medium-4">
|
||||
<label>
|
||||
Benchmarks
|
||||
<select name="test_benchmarks[]" multiple>
|
||||
<% for b in benchmarks %>
|
||||
<option value="<%= b.id %>"><%= b.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="cell medium-8">
|
||||
<label>
|
||||
Test description
|
||||
<textarea name="test_description" placeholder="This is my test for a hardware..."></textarea>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="button" value="Submit">
|
||||
<div class="row mb-0 mb-md-3">
|
||||
<div class="col-12 col-md-4 mb-3 mb-md-0">
|
||||
<label for="test_benchmarks">Benchmarks</label>
|
||||
<select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
|
||||
<% for b in benchmarks %>
|
||||
<option value="<%= b.id %>"><%= b.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-8 mb-3 mb-md-0">
|
||||
<label for="test_description">Test description</label>
|
||||
<textarea id="test_description" class="form-control" name="test_description" placeholder="This is my test for a hardware..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input class="btn btn-primary w-100" type="submit" value="Create Test">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -1,32 +1,49 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<h1>Editing: <%= hardware.name %></h1>
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h1>Editing: <%= test.name %></h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row">
|
||||
|
||||
<form class="cell small-12" action="/hardware/<%= hardware.id %>/edit" method="post">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell medium-9">
|
||||
<label>
|
||||
Hardware name
|
||||
<input type="text" name="hardware_name" placeholder="Example hardware" value="<%= hardware.name %>">
|
||||
</label>
|
||||
<form class="col-12" action="/test/<%= test.id %>/edit" method="post">
|
||||
<div class="row mb-0 mb-md-3">
|
||||
<div class="col-12 col-md-6 mb-3 mb-md-0">
|
||||
<label for="test_name">Test name</label>
|
||||
<input id="test_name" class="form-control" type="text" name="test_name" placeholder="My hardware test (01/99)" value="<%= test.name %>">
|
||||
</div>
|
||||
|
||||
<div class="cell medium-3">
|
||||
<label>
|
||||
Type
|
||||
<select name="hardware_type">
|
||||
<option value="gpu" <% if hardware.type == 'gpu' %>selected<% end %>>Graphics card</option>
|
||||
<option value="cpu" <% if hardware.type == 'cpu' %>selected<% end %>>Processor</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="col-12 col-md-6 mb-3 mb-md-0">
|
||||
<label for="test_hardware">Hardware to test</label>
|
||||
<select id="test_hardware" class="form-select" name="test_hardware">
|
||||
<% for h in hardware %>
|
||||
<option value="<%= h.id %>" <% if h.id == test.hardware.id %>selected<% end %>><%= h.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="submit" class="button" value="Submit">
|
||||
<div class="row mb-0 mb-md-3">
|
||||
<div class="col-12 col-md-4 mb-3 mb-md-0">
|
||||
<label for="test_benchmarks">Benchmarks</label>
|
||||
<select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
|
||||
<% for b in benchmarks %>
|
||||
<option value="<%= b.id %>" <% if test.has_benchmark(b.id) %>selected<% end %>><%= b.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-8 mb-3 mb-md-0">
|
||||
<label for="test_description">Test description</label>
|
||||
<textarea id="test_description" class="form-control" name="test_description" placeholder="This is my test for a hardware..."><%= test.description %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<input class="btn btn-primary w-100" type="submit" value="Submit Changes">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
@ -1,20 +1,20 @@
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="cell small-12">
|
||||
<div class="row mb-3">
|
||||
<div class="col-12">
|
||||
<h1>List of tests</h1>
|
||||
</div>
|
||||
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p>
|
||||
<a href="/test/add">Add new test</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-margin-x">
|
||||
<div class="row mb-3">
|
||||
<% if tests.length > 0 %>
|
||||
<div class="cell small-12">
|
||||
<table>
|
||||
<thead>
|
||||
<div class="col-12">
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Test name</th>
|
||||
<th># of benchmarks</th>
|
||||
@ -26,7 +26,7 @@
|
||||
<% tests.each do |t| %>
|
||||
<tr>
|
||||
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
||||
<td><%= t.benchmark.length %></td>
|
||||
<td><%= t.benchmarks.length %></td>
|
||||
<td><%= date_format(t.created_at) %></td>
|
||||
<td><%= date_format(t.updated_at) %></td>
|
||||
</tr>
|
||||
@ -35,7 +35,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="cell small-12">
|
||||
<div class="col-12">
|
||||
<p>I'm sorry, there doesn't appear to be any tests added yet. Check again later!</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -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: <a href="/hardware/<%= test.hardware.id %>"><%= test.hardware.name %></a></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| %>
|
||||
<option value="<%= b.id %>"><%= b.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
</label>
|
||||
<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>
|
||||
</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