Merge pull request #35 from dolfje/master

- Back out change of suiteVersion to suiteId
This commit is contained in:
Hannes Verschore 2014-11-28 00:08:41 +01:00
Родитель f659fecf58 039862fb9a
Коммит 04ad55450f
4 изменённых файлов: 31 добавлений и 58 удалений

Просмотреть файл

@ -9,7 +9,7 @@ include "../internals.php";
init_database(); init_database();
$machine = (int)$_GET["machine"]; $machine = (int)$_GET["machine"];
$suite = (int)$_GET["suite"]; $suiteVersion = (int)$_GET["suiteVersion"];
$query = "SELECT id, stamp FROM `awfy_run` $query = "SELECT id, stamp FROM `awfy_run`
WHERE machine = $machine AND WHERE machine = $machine AND
@ -23,19 +23,18 @@ $row = mysql_fetch_array($results);
$runId = $row[0]; $runId = $row[0];
$overview["machine"] = $machine; $overview["machine"] = $machine;
$overview["stamp"] = $row[1]; $overview["stamp"] = $row[1];
$overview["suiteVersion"] = $suiteVersion;
$query = "SELECT awfy_suite_version.id FROM `awfy_suite` if (!has_permissions()) {
$query = "SELECT awfy_suite.id FROM `awfy_suite`
LEFT JOIN awfy_suite_version on suite_id = awfy_suite.id LEFT JOIN awfy_suite_version on suite_id = awfy_suite.id
WHERE awfy_suite.id = $suiteId "; WHERE awfy_suite_version.id = $suiteVersion AND
if (!has_permissions()) visible = 1
$query .= "AND visible = 1 "; LIMIT 1";
$query .= "LIMIT 1"; $results = mysql_query($query);
$results = mysql_query($query); if (!$results || mysql_num_rows($results) != 1)
if (!$results || mysql_num_rows($results) != 1)
die(); die();
$row = mysql_fetch_array($results); }
$suiteVersion = $row[0];
$overview["suiteVersion"] = $row[0];
$query = "SELECT id, mode_id FROM `awfy_build` $query = "SELECT id, mode_id FROM `awfy_build`
WHERE run_id = $runId"; WHERE run_id = $runId";

Просмотреть файл

@ -44,6 +44,12 @@ awfyApp.controller('pageCtrl', ['$scope', '$http', '$q', '$location',
var path = $location.path().split("/"); var path = $location.path().split("/");
if(path[2].indexOf(",") == -1) { if(path[2].indexOf(",") == -1) {
$scope.selectedMachine = master["machines"][path[2]]; $scope.selectedMachine = master["machines"][path[2]];
} else {
$scope.machines.push({
id: path[2],
description: "Multipe machines",
});
$scope.selectedMachine = $scope.machines[$scope.machines.length-1];
} }
// Watch for changes of selection // Watch for changes of selection

Просмотреть файл

@ -48,14 +48,17 @@ awfyCtrl.controller('overviewCtrl', ['$scope', '$http', '$routeParams', '$q',
machine = JSON.parse(machine); machine = JSON.parse(machine);
machines.push(machine); machines.push(machine);
} }
console.log(machines);
$scope.$parent.date = machines[0].stamp*1000; // Show date
$scope.$parent.date = machines[0].stamp*1000;
if($routeParams.suite) { if($routeParams.suite) {
$scope.name = master["suiteversions"][$routeParams.suite]["name"]; $scope.name = master["suiteversions"][$routeParams.suite]["name"];
$scope.code = master["suiteversions"][$routeParams.suite]["suite"]; $scope.code = master["suiteversions"][$routeParams.suite]["suite"];
} }
$scope.numMachines = data.length-1;
// Get all testsuites ids // Get all testsuites ids
var testsuites = {}; var testsuites = {};
for(var i in machines) { for(var i in machines) {
@ -140,7 +143,7 @@ $scope.$parent.date = machines[0].stamp*1000;
machine.tests.push({ machine.tests.push({
name: master["modes"][test["modeid"]]["name"], name: master["modes"][test["modeid"]]["name"],
score: test["score"], score: Math.round(test["score"], 2),
ff: isFF(master["modes"][test["modeid"]]["name"]) ? "ff" : "", ff: isFF(master["modes"][test["modeid"]]["name"]) ? "ff" : "",
}); });
@ -156,45 +159,6 @@ $scope.$parent.date = machines[0].stamp*1000;
return; return;
// Create testsuites
for(key in overview["data"]) {
var suite = overview["data"][key]
if(!$routeParams.suite && suite["suiteversionid"] == -1)
continue;
var name;
if(!$routeParams.suite) {
name = master["suiteversions"][suite["suiteversionid"]]["name"];
} else {
name = suite["suitetest"];
}
var testsuite = {
name: name,
tests: [],
maxScore: 0,
};
if(!$routeParams.suite) {
testsuite.id = suite["suiteversionid"];
}
for(key in suite["scores"]) {
var test = suite["scores"][key];
testsuite.tests.push({
name: master["modes"][test["modeid"]]["name"],
score: test["score"],
ff: isFF(master["modes"][test["modeid"]]["name"]) ? "ff" : "",
});
testsuite.maxScore = Math.max(testsuite.maxScore, test["score"]*1);
}
$scope.testsuites.push(testsuite);
}
}); });
$scope.machineId = $routeParams.machine; $scope.machineId = $routeParams.machine;

Просмотреть файл

@ -15,12 +15,12 @@
<div class='button' ng-if='hasSuite'> <div class='button' ng-if='hasSuite'>
<a class='up' ng-href='#/machine/{{machineId}}'></a> <a class='up' ng-href='#/machine/{{machineId}}'></a>
</div> </div>
<div class='button' ng-if='!hasSuite'> <!--<div class='button' ng-if='!hasSuite'>
<a class='history' ng-href='../?machine={{machineId}}'>History</a> <a class='history' ng-href='../?machine={{machineId}}'>History</a>
</div> </div>
<div class='button' ng-if='hasSuite'> <div class='button' ng-if='hasSuite'>
<a class='history' ng-href='../?machine={{machineId}}&view=breakdown&suite={{code}}'>History</a> <a class='history' ng-href='../?machine={{machineId}}&view=breakdown&suite={{code}}'>History</a>
</div> </div>-->
</div> </div>
<h2 ng-if='!hasSuite'> <h2 ng-if='!hasSuite'>
@ -36,7 +36,7 @@
<div class='header'>{{testsuite.name}}</div> <div class='header'>{{testsuite.name}}</div>
<div class='content'> <div class='content'>
<div ng-repeat="machine in testsuite.machines"> <div ng-repeat="machine in testsuite.machines">
<h3 ng-if="testsuite.machines.length != 1">{{machine.name}}</h3> <h3 ng-if="numMachines != 1">{{machine.name}}</h3>
<div ng-repeat="test in machine.tests"> <div ng-repeat="test in machine.tests">
<div class='score'>{{test.score}}</div> <div class='score'>{{test.score}}</div>
<div class='title'>{{test.name}}</div> <div class='title'>{{test.name}}</div>
@ -46,6 +46,10 @@
</div> </div>
<div class='footer' ng-if='!hasSuite'> <div class='footer' ng-if='!hasSuite'>
<a class='subtests' ng-href='#/machine/{{machineId}}/suite/{{testsuite.id}}'>Subtests</a> <a class='subtests' ng-href='#/machine/{{machineId}}/suite/{{testsuite.id}}'>Subtests</a>
<a class='history' ng-href='../#machine={{machineId}}&view=single&suite={{testsuite.name}}'>History</a>
</div>
<div class='footer' ng-if='hasSuite'>
<a class='history' ng-href='../#machine={{machineId}}&view=single&suite={{testsuite.name}}&subtest={{testsuite.name}}'>History</a>
</div> </div>
</div> </div>
</div> </div>