This commit is contained in:
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user