- Back out change of suiteVersion to suiteId

- Add new history links
- Show machine naming always (when multiple machines are selected)
- Show "Multiple machine" in header when multiple machines are selected
This commit is contained in:
vagrant 2014-11-27 23:05:05 +00:00
Родитель f659fecf58
Коммит 039862fb9a
4 изменённых файлов: 31 добавлений и 58 удалений

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

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

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

@ -44,6 +44,12 @@ awfyApp.controller('pageCtrl', ['$scope', '$http', '$q', '$location',
var path = $location.path().split("/");
if(path[2].indexOf(",") == -1) {
$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

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

@ -48,14 +48,17 @@ awfyCtrl.controller('overviewCtrl', ['$scope', '$http', '$routeParams', '$q',
machine = JSON.parse(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) {
$scope.name = master["suiteversions"][$routeParams.suite]["name"];
$scope.code = master["suiteversions"][$routeParams.suite]["suite"];
}
$scope.numMachines = data.length-1;
// Get all testsuites ids
var testsuites = {};
for(var i in machines) {
@ -140,7 +143,7 @@ $scope.$parent.date = machines[0].stamp*1000;
machine.tests.push({
name: master["modes"][test["modeid"]]["name"],
score: test["score"],
score: Math.round(test["score"], 2),
ff: isFF(master["modes"][test["modeid"]]["name"]) ? "ff" : "",
});
@ -156,45 +159,6 @@ $scope.$parent.date = machines[0].stamp*1000;
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;

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

@ -15,12 +15,12 @@
<div class='button' ng-if='hasSuite'>
<a class='up' ng-href='#/machine/{{machineId}}'></a>
</div>
<div class='button' ng-if='!hasSuite'>
<!--<div class='button' ng-if='!hasSuite'>
<a class='history' ng-href='../?machine={{machineId}}'>History</a>
</div>
<div class='button' ng-if='hasSuite'>
<a class='history' ng-href='../?machine={{machineId}}&view=breakdown&suite={{code}}'>History</a>
</div>
</div>-->
</div>
<h2 ng-if='!hasSuite'>
@ -36,7 +36,7 @@
<div class='header'>{{testsuite.name}}</div>
<div class='content'>
<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 class='score'>{{test.score}}</div>
<div class='title'>{{test.name}}</div>
@ -46,6 +46,10 @@
</div>
<div class='footer' ng-if='!hasSuite'>
<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>