diff --git a/website/overview/data-suite.php b/website/overview/data-suite.php index 60ec60c..1cb90aa 100644 --- a/website/overview/data-suite.php +++ b/website/overview/data-suite.php @@ -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` - 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) - die(); -$row = mysql_fetch_array($results); -$suiteVersion = $row[0]; -$overview["suiteVersion"] = $row[0]; +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_version.id = $suiteVersion AND + visible = 1 + LIMIT 1"; + $results = mysql_query($query); + if (!$results || mysql_num_rows($results) != 1) + die(); +} $query = "SELECT id, mode_id FROM `awfy_build` WHERE run_id = $runId"; diff --git a/website/overview/js/app.js b/website/overview/js/app.js index e8bcc30..440018d 100644 --- a/website/overview/js/app.js +++ b/website/overview/js/app.js @@ -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 diff --git a/website/overview/js/controllers.js b/website/overview/js/controllers.js index 3d5a323..2b345fb 100644 --- a/website/overview/js/controllers.js +++ b/website/overview/js/controllers.js @@ -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; diff --git a/website/overview/partials/overview.html b/website/overview/partials/overview.html index 0c60d22..e1fe6a6 100644 --- a/website/overview/partials/overview.html +++ b/website/overview/partials/overview.html @@ -15,12 +15,12 @@
-
+

@@ -36,7 +36,7 @@
{{testsuite.name}}
-

{{machine.name}}

+

{{machine.name}}

{{test.score}}
{{test.name}}
@@ -46,6 +46,10 @@
+