diff --git a/public/css/eye.css b/public/css/eye.css index 8b17f68..377446a 100644 --- a/public/css/eye.css +++ b/public/css/eye.css @@ -15,6 +15,14 @@ body{ background: #eee; } +a{ + color: teal; + transition: all 200ms ease-in-out; +} +a:hover{ + color: #007070; +} + textarea{ max-width: 100%; min-width: 100%; @@ -25,6 +33,10 @@ textarea{ max-width: 1024px; } +select[multiple]{ + min-height: 125px; +} + #main-nav{ position: fixed; top: 0; @@ -81,3 +93,10 @@ textarea{ margin-bottom: 5px; text-align: center; } + +#result_form{ + margin-bottom: 0; +} +#result_form *{ + margin-bottom: 0; +} diff --git a/src/models/index.js b/src/models/index.js index 0a8f232..3f620d8 100644 --- a/src/models/index.js +++ b/src/models/index.js @@ -8,6 +8,7 @@ const sequelize = new Sequelize({ const Hardware = require('./hardware')(sequelize); const Benchmark = require('./benchmark')(sequelize); const Test = require('./test')(sequelize); +const Result = require('./result')(sequelize); // Hardware/Test one-to-many Hardware.hasMany(Test); @@ -17,4 +18,12 @@ Test.belongsTo(Hardware); Benchmark.belongsToMany(Test, { through: 'tests_benchmarks' }); Test.belongsToMany(Benchmark, { through: 'tests_benchmarks' }); +// Result/Benchmark many-to-one +Result.belongsTo(Benchmark); +Benchmark.hasMany(Result); + +// Result/Test many-to-one +Result.belongsTo(Test); +Test.hasMany(Result); + module.exports = sequelize; diff --git a/src/models/result.js b/src/models/result.js new file mode 100644 index 0000000..22e1726 --- /dev/null +++ b/src/models/result.js @@ -0,0 +1,22 @@ +const { Sequelize } = require("sequelize"); + +module.exports = (sequelize) => { + const Result = sequelize.define('Result', { + avgScore: { + type: Sequelize.DOUBLE, + null: false, + }, + minScore: { + type: Sequelize.DOUBLE, + null: true, + }, + maxScore: { + type: Sequelize.DOUBLE, + null: true, + } + }, + { + tableName: 'results' + }); + return Result; +}; diff --git a/src/routes/test.js b/src/routes/test.js index b5b1f56..3cbe28b 100644 --- a/src/routes/test.js +++ b/src/routes/test.js @@ -9,7 +9,7 @@ exports.getIndex = async function(req, res) { // GET /test/list - list of tests exports.getList = async function(req, res) { - var tests = await Test.findAll(); + var tests = await Test.findAll({order: [['updatedAt', 'DESC']]}); res.render('test/list', { tests: tests }); diff --git a/views/test/view.twig b/views/test/view.twig index ab53ab3..7348010 100644 --- a/views/test/view.twig +++ b/views/test/view.twig @@ -5,13 +5,79 @@ {% block content %}

Test: {{ test.getHardware().name }} - {{ test.dateTag }}

+
+
+ +
+
+ + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+
+
+ +
+ +
- +

Benchmarks

+ + + + + + + + + + + + {% for b in test.getBenchmarks() %} + + + + + + + + {% endfor %} + +
Benchmark# ResultsAvg.Min.Max.
{{ b.name }}{{ test.getResults({where: {testId: test.id}})|length }}N/aN/aN/a