Added report generation page
This commit is contained in:
parent
de01e4b144
commit
27c9267261
22
src/Controllers/ReportController.php
Normal file
22
src/Controllers/ReportController.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace BitGoblin\Colossus\Controllers;
|
||||||
|
|
||||||
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
use Slim\Routing\RouteContext;
|
||||||
|
use Slim\Views\Twig;
|
||||||
|
use BitGoblin\Colossus\Models\Benchmark;
|
||||||
|
|
||||||
|
class ResultController extends Controller {
|
||||||
|
|
||||||
|
public function getGenerate(Request $request, Response $response): Response {
|
||||||
|
$benchmarks = Benchmark::get();
|
||||||
|
|
||||||
|
$view = Twig::fromRequest($request);
|
||||||
|
return $view->render($response, 'reports/generate.twig', [
|
||||||
|
'benchmarks' => $benchmarks,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -30,3 +30,7 @@ $app->group('/test', function(RouteCollectorProxy $group) {
|
|||||||
$app->group('/result', function(RouteCollectorProxy $group) {
|
$app->group('/result', function(RouteCollectorProxy $group) {
|
||||||
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\ResultController:postAdd')->setName('result.add');
|
$group->post('/add', '\\BitGoblin\\Colossus\\Controllers\\ResultController:postAdd')->setName('result.add');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$app->group('/reports', function(RouteCollectorProxy $group) {
|
||||||
|
$group->get('/generate', '\\BitGoblin\\Colossus\Controllers\ReportController:getGenerate')->setName('reports.generate');
|
||||||
|
});
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<li><a href="{{ url_for('benchmark.list') }}">Benchmarks</a></li>
|
<li><a href="{{ url_for('benchmark.list') }}">Benchmarks</a></li>
|
||||||
<li><a href="{{ url_for('component.list') }}">Components</a></li>
|
<li><a href="{{ url_for('component.list') }}">Components</a></li>
|
||||||
<li><a href="{{ url_for('test.list') }}">Test</a></li>
|
<li><a href="{{ url_for('test.list') }}">Test</a></li>
|
||||||
|
<li><a href="{{ url_for('reports.generate') }}">Reports</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
|
33
views/reports/generate.twig
Normal file
33
views/reports/generate.twig
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{% extends 'layout.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Dashboard{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="twelve columns">
|
||||||
|
<h1>Generate a Report</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="five columns">
|
||||||
|
<select id="report-benchmarks" class="u-full-width">
|
||||||
|
{% for b in benchmarks %}
|
||||||
|
<option value="{{ b.id }}">{{ b.name }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="seven columns">
|
||||||
|
<select id="report-tests" class="u-full-width" multiple>
|
||||||
|
{% for t in benchmarks[0].tests %}
|
||||||
|
<option value="{{ t.id }}">{{ t.title }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user