Compare commits
2 Commits
31b8404be1
...
aec77628f7
Author | SHA1 | Date | |
---|---|---|---|
aec77628f7 | |||
ecb696372d |
@ -2,7 +2,7 @@ FROM ruby:3.4
|
|||||||
|
|
||||||
RUN gem install bundler
|
RUN gem install bundler
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /usr/src/game-data
|
||||||
|
|
||||||
COPY Gemfile Gemfile.l*ck ./
|
COPY Gemfile Gemfile.l*ck ./
|
||||||
|
|
||||||
@ -13,3 +13,4 @@ RUN gem install rake
|
|||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
ENTRYPOINT ["bash", "entrypoints/dev.sh"]
|
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" ]
|
@ -7,7 +7,8 @@ $(document).ready ->
|
|||||||
data:
|
data:
|
||||||
type: $('#report_type').val()
|
type: $('#report_type').val()
|
||||||
choice: $('#report_choice').val()
|
choice: $('#report_choice').val()
|
||||||
compare: $('#report_compare').val()).done (data) ->
|
compare: $('#report_compare').val()
|
||||||
|
).done (data) ->
|
||||||
benchChart.options.title.text = data.choice
|
benchChart.options.title.text = data.choice
|
||||||
benchChart.data.labels = data.names
|
benchChart.data.labels = data.names
|
||||||
benchChart.data.datasets[0].data = data.avg_results
|
benchChart.data.datasets[0].data = data.avg_results
|
||||||
|
@ -3,8 +3,3 @@
|
|||||||
|
|
||||||
h1.invalid
|
h1.invalid
|
||||||
color: red
|
color: red
|
||||||
|
|
||||||
.button
|
|
||||||
position: relative
|
|
||||||
top: -25%
|
|
||||||
margin-top: 50%
|
|
||||||
|
@ -1 +1,2 @@
|
|||||||
docker build -t game-data -f Dockerfile.dev .
|
docker build -t game-data -f Dockerfile.dev .
|
||||||
|
docker build -t game-data-gulp -f Dockerfile.gulp .
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
docker build -t game-data -f Dockerfile.dev .
|
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
|
#!/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
|
||||||
|
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
class GameData < Sinatra::Base
|
class GameData < Sinatra::Base
|
||||||
|
|
||||||
get '/' do
|
get '/' do
|
||||||
results = Result.reverse(:updated_at).limit(10).all()
|
tests = Test.reverse(:updated_at).limit(10).all()
|
||||||
|
|
||||||
erb :'index/index', locals: {
|
erb :'index/index', locals: {
|
||||||
title: 'Dashboard',
|
title: 'Dashboard',
|
||||||
results: results
|
tests: tests
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@ class GameData < Sinatra::Base
|
|||||||
|
|
||||||
get '/reports' do
|
get '/reports' do
|
||||||
benchmarks = Benchmark.order(:name).all()
|
benchmarks = Benchmark.order(:name).all()
|
||||||
hardware = Hardware.order(:name).all()
|
tests = Test.order(:name).all()
|
||||||
|
|
||||||
erb :'reports/index', locals: {
|
erb :'reports/index', locals: {
|
||||||
title: 'Generate Reports',
|
title: 'Generate Reports',
|
||||||
hardware: hardware,
|
tests: tests,
|
||||||
benchmarks: benchmarks
|
benchmarks: benchmarks
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -26,10 +26,10 @@ class GameData < Sinatra::Base
|
|||||||
min_results = []
|
min_results = []
|
||||||
|
|
||||||
report_compare.each do |c|
|
report_compare.each do |c|
|
||||||
hrd = Hardware.where(id: c).first()
|
tst = Test.where(id: c).first()
|
||||||
names.push(hrd.name)
|
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)
|
avg_results.push(res.avg_score)
|
||||||
min_results.push(res.min_score)
|
min_results.push(res.min_score)
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="grid-x grid-margin-x">
|
<div class="grid-x grid-margin-x">
|
||||||
<% if results.length > 0 %>
|
<% if tests.length > 0 %>
|
||||||
<div class="cell small-12">
|
<div class="cell small-12">
|
||||||
<h2>Latest benchmark results:</h2>
|
<h2>Latest benchmark results:</h2>
|
||||||
</div>
|
</div>
|
||||||
@ -7,17 +7,17 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Hardware tested</th>
|
<th>Test name</th>
|
||||||
<th>Benchmark used</th>
|
<th># Benchmarks</th>
|
||||||
<th>Score</th>
|
<th>Last Updated</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% results.each do |r| %>
|
<% tests.each do |t| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= r.hardware.name %></td>
|
<td><%= t.name %></td>
|
||||||
<td><%= r.benchmark.name %></td>
|
<td><%= t.benchmark.length %></td>
|
||||||
<td><%= r.formatted_score() %></td>
|
<td><%= t.updated_at %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="grid-x grid-margin-x">
|
<div class="grid-x grid-margin-x">
|
||||||
<select class="cell medium-6" id="report_type" name="report_type" disabled>
|
<select class="cell medium-6" id="report_type" name="report_type" disabled>
|
||||||
<option value="benchmark">Benchmark</option>
|
<option value="benchmark">Benchmark</option>
|
||||||
<option value="hardware">Hardware</option>
|
<option value="test">Test</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select class="cell medium-6" id="report_choice" name="report_choice">
|
<select class="cell medium-6" id="report_choice" name="report_choice">
|
||||||
@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
<div class="grid-x grid-margin-x">
|
<div class="grid-x grid-margin-x">
|
||||||
<select class="cell small-12" id="report_compare" name="report_compare[]" multiple>
|
<select class="cell small-12" id="report_compare" name="report_compare[]" multiple>
|
||||||
<% hardware.each do |h| %>
|
<% tests.each do |t| %>
|
||||||
<option value="<%= h.id %>"><%= h.name %></option>
|
<option value="<%= t.id %>"><%= t.name %></option>
|
||||||
<% end %>
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user