From aec77628f78342d4787801f1bec7bd4bceb571aa Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Wed, 23 Jul 2025 23:25:00 -0400 Subject: [PATCH] Small updates --- assets/scripts/reports.coffee | 3 ++- assets/styles/rimmington.sass | 5 ----- src/routes/index.rb | 4 ++-- src/routes/reports.rb | 10 +++++----- views/index/index.erb | 16 ++++++++-------- views/reports/index.erb | 6 +++--- 6 files changed, 20 insertions(+), 24 deletions(-) diff --git a/assets/scripts/reports.coffee b/assets/scripts/reports.coffee index 9b2a2c4..f1a285e 100644 --- a/assets/scripts/reports.coffee +++ b/assets/scripts/reports.coffee @@ -7,7 +7,8 @@ $(document).ready -> data: type: $('#report_type').val() choice: $('#report_choice').val() - compare: $('#report_compare').val()).done (data) -> + 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 diff --git a/assets/styles/rimmington.sass b/assets/styles/rimmington.sass index d220dfa..650a535 100644 --- a/assets/styles/rimmington.sass +++ b/assets/styles/rimmington.sass @@ -3,8 +3,3 @@ h1.invalid color: red - -.button - position: relative - top: -25% - margin-top: 50% diff --git a/src/routes/index.rb b/src/routes/index.rb index a5cadf5..37a2f45 100644 --- a/src/routes/index.rb +++ b/src/routes/index.rb @@ -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 diff --git a/src/routes/reports.rb b/src/routes/reports.rb index 07a8087..66a68f2 100644 --- a/src/routes/reports.rb +++ b/src/routes/reports.rb @@ -5,11 +5,11 @@ class GameData < Sinatra::Base get '/reports' 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 @@ -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 diff --git a/views/index/index.erb b/views/index/index.erb index 3490a5d..e99f42e 100644 --- a/views/index/index.erb +++ b/views/index/index.erb @@ -1,5 +1,5 @@
- <% if results.length > 0 %> + <% if tests.length > 0 %>

Latest benchmark results:

@@ -7,17 +7,17 @@ - - - + + + - <% results.each do |r| %> + <% tests.each do |t| %> - - - + + + <% end %> diff --git a/views/reports/index.erb b/views/reports/index.erb index e5948d4..e050ffd 100644 --- a/views/reports/index.erb +++ b/views/reports/index.erb @@ -3,7 +3,7 @@
- <% hardware.each do |h| %> - + <% tests.each do |t| %> + <% end %>
Hardware testedBenchmark usedScoreTest name# BenchmarksLast Updated
<%= r.hardware.name %><%= r.benchmark.name %><%= r.formatted_score() %><%= t.name %><%= t.benchmark.length %><%= t.updated_at %>