diff options
author | Juha Sippola <juhasippola@outlook.com> | 2015-07-01 16:10:05 +0300 |
---|---|---|
committer | Tony Sarajärvi <tony.sarajarvi@theqtcompany.com> | 2015-09-16 07:32:03 +0000 |
commit | 64a14e09f7d3a73f58758f67fe35a779f56f580b (patch) | |
tree | 6fe4162566943457a86a2914716d01eab7fda99f /non-puppet/qtmetrics2/index.php | |
parent | 17114a51b5015b5af18818c30344bbe5365d7a6c (diff) |
Qt Metrics 2 (v0.7): Overview and Project pages
Implemented the overview page to show status of the
latest Qt5 state build for each branch including
the build result itself and the testset results in
the Qt5 state builds (testset results are shown by
testset project).
Implemented the build project (Qt5 state in practice)
and testset project pages, the first to show the
build results and the latter to show the testset
results. Both are linked from the overview page,
and the testset project page also from the new
search box on the home page.
Change-Id: Iaa97597b63e05af426e6749af2b2cbadbb492eb7
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
Diffstat (limited to 'non-puppet/qtmetrics2/index.php')
-rw-r--r-- | non-puppet/qtmetrics2/index.php | 118 |
1 files changed, 112 insertions, 6 deletions
diff --git a/non-puppet/qtmetrics2/index.php b/non-puppet/qtmetrics2/index.php index 746ffbe..811c126 100644 --- a/non-puppet/qtmetrics2/index.php +++ b/non-puppet/qtmetrics2/index.php @@ -34,8 +34,8 @@ /** * Qt Metrics API - * @version 0.5 - * @since 25-06-2015 + * @version 0.7 + * @since 30-06-2015 * @author Juha Sippola */ @@ -67,16 +67,106 @@ $app->get('/', function() use($app) 'platformRoute' => Slim\Slim::getInstance()->urlFor('root') . 'platform', 'testRoute' => Slim\Slim::getInstance()->urlFor('root') . 'test', 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)', - 'states' => Factory::db()->getStates(), + 'masterProject' => $ini['master_build_project'], + 'masterState' => $ini['master_build_state'], 'branches' => Factory::db()->getBranches(), - 'projects' => Factory::createProjects( - $ini['master_build_project'], - $ini['master_build_state']), // managed as objects 'platforms' => Factory::db()->getTargetPlatforms() )); })->name('root'); /** + * UI route: /overview (GET) + */ + +$app->get('/overview', function() use($app) +{ + $ini = Factory::conf(); + $breadcrumb = array( + array('name' => 'home', 'link' => Slim\Slim::getInstance()->urlFor('root')) + ); + $app->render('overview.html', array( + 'root' => Slim\Slim::getInstance()->urlFor('root'), + 'breadcrumb' => $breadcrumb, + 'buildProjectRoute' => Slim\Slim::getInstance()->urlFor('root') . 'buildproject', + 'testsetProjectRoute' => Slim\Slim::getInstance()->urlFor('root') . 'testsetproject', + 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)', + 'masterProject' => $ini['master_build_project'], + 'masterState' => $ini['master_build_state'], + 'latestProjectRuns' => Factory::db()->getLatestProjectBranchBuildResults( + $ini['master_build_project'], + $ini['master_build_state']), + 'latestTestsetRuns' => Factory::db()->getLatestProjectBranchTestsetResults( + $ini['master_build_project'], + $ini['master_build_state']) + )); +}); + +/** + * UI route: /buildproject (GET) + */ + +$app->get('/buildproject/:project', function($project) use($app) +{ + $project = strip_tags($project); + $ini = Factory::conf(); + $breadcrumb = array( + array('name' => 'home', 'link' => Slim\Slim::getInstance()->urlFor('root')) + ); + $app->render('build_project.html', array( + 'root' => Slim\Slim::getInstance()->urlFor('root'), + 'breadcrumb' => $breadcrumb, + 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)', + 'masterProject' => $ini['master_build_project'], + 'masterState' => $ini['master_build_state'], + 'latestProjectRuns' => Factory::db()->getLatestProjectBranchBuildResults( + $project, + $ini['master_build_state']), + 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( + $ini['master_build_project'], + $ini['master_build_state']), + 'project' => Factory::createProject( + $project, + $ini['master_build_project'], + $ini['master_build_state']), // managed as object + 'confRuns' => Factory::createConfRuns( + $ini['master_build_project'], + $ini['master_build_state']) // managed as objects + )); +}); + +/** + * UI route: /testsetproject (GET) + */ + +$app->get('/testsetproject/:project', function($project) use($app) +{ + $project = strip_tags($project); + $ini = Factory::conf(); + $breadcrumb = array( + array('name' => 'home', 'link' => Slim\Slim::getInstance()->urlFor('root')) + ); + $app->render('testset_project.html', array( + 'root' => Slim\Slim::getInstance()->urlFor('root'), + 'breadcrumb' => $breadcrumb, + 'refreshed' => Factory::db()->getDbRefreshed() . ' (GMT)', + 'masterProject' => $ini['master_build_project'], + 'masterState' => $ini['master_build_state'], + 'project' => $project, + 'latestTestsetRuns' => Factory::db()->getLatestTestsetProjectBranchTestsetResults( + $project, + $ini['master_build_project'], + $ini['master_build_state']), + 'projectBuilds' => Factory::db()->getProjectBuildsByBranch( + $ini['master_build_project'], + $ini['master_build_state']), + 'confBuilds' => Factory::db()->getTestsetProjectResultsByBranchConf( + $project, + $ini['master_build_project'], + $ini['master_build_state']) + )); +}); + +/** * UI route: /test/top (GET) */ @@ -183,6 +273,22 @@ $app->run(); /** + * Handle the project name input selection on home page and redirect to testset project page + */ + +if (isset($_POST["projectInputSubmit"])) { + if (empty($_POST["projectInputValue"])) { + header('Location: ' . Slim\Slim::getInstance()->urlFor('root')); + exit(); + } + if (isset($_POST["projectInputValue"])) { + $project = htmlspecialchars($_POST['projectInputValue']); + header('Location: ' . Slim\Slim::getInstance()->urlFor('root') . 'testsetproject/' . $project); + exit(); + } +} + +/** * Handle the testset name input selection on home page and redirect to testset page */ |