- Make login work (persona)
- Add "lower is better" - History buttons has wrong suite names - Update machine select when url changes - Put rounding at 2 decimals
This commit is contained in:
Родитель
8da45ec3dd
Коммит
66fc44df45
|
@ -8,10 +8,7 @@ if(isset($_GET['persona'])) {
|
|||
|
||||
// Login
|
||||
if(isset($_GET['assertion'])) {
|
||||
if ($_SERVER['HTTP_HOST'] == "www.arewefastyet.com")
|
||||
$verifier = new Auth_BrowserID('http://www.arewefastyet.com');
|
||||
else
|
||||
$verifier = new Auth_BrowserID('http://arewefastyet.com');
|
||||
$verifier = new Auth_BrowserID("http://".$_SERVER['HTTP_HOST']);
|
||||
$result = $verifier->verifyAssertion($_GET['assertion']);
|
||||
|
||||
if ($result->status === 'okay') {
|
||||
|
|
|
@ -58,7 +58,15 @@
|
|||
padding: 12px;
|
||||
color: #42637b;
|
||||
}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/\/vagrant\/public\/arewefastyet\.firefox\.local\/arewefastyet\/website\/overview\/sass\/utility\/abstractions\/_box\.scss}line{font-family:\0000339}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/\/vagrant\/public\/arewefastyet\.firefox\.local\/arewefastyet\/website\/overview\/sass\/utility\/abstractions\/_box\.scss}line{font-family:\0000345}}
|
||||
.box .legend {
|
||||
text-align: right;
|
||||
font-size: 9px;
|
||||
text-transform: uppercase;
|
||||
margin-top: 18px;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/\/vagrant\/public\/arewefastyet\.firefox\.local\/arewefastyet\/website\/overview\/sass\/utility\/abstractions\/_box\.scss}line{font-family:\0000353}}
|
||||
.box .score {
|
||||
float: right;
|
||||
font-size: 1.4em;
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
<script type="text/javascript" src="../jquery/jquery-1.8.3.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular-route.js"></script>
|
||||
<script src="https://login.persona.org/include.js"></script>
|
||||
<script src="js/persona.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/controllers.js"></script>
|
||||
|
||||
|
@ -32,8 +34,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class='userMenu'>
|
||||
<a id='personaLogin' href="javascript:doLogin()"><span>Login</span></a>
|
||||
<a id='personaLogout' href="javascript:doLogout()" style='display: none;'><span>Logout</span></a>
|
||||
<a id='personaLogin' href="javascript:doPersonaLogin()"><span>Login</span></a>
|
||||
<a id='personaLogout' href="javascript:doPersonaLogout()" style='display: none;'><span>Logout</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -40,20 +40,12 @@ awfyApp.controller('pageCtrl', ['$scope', '$http', '$q', '$location',
|
|||
}
|
||||
}
|
||||
|
||||
// Put select in proper format
|
||||
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
|
||||
$scope.$watch('selectedMachine', function (machine) {
|
||||
$scope.$watch('selectedMachine', function (machine) {
|
||||
if(!machine) {
|
||||
return;
|
||||
}
|
||||
|
||||
var path = $location.path().split("/");
|
||||
path[2] = machine.id;
|
||||
|
||||
|
|
|
@ -49,6 +49,17 @@ awfyCtrl.controller('overviewCtrl', ['$scope', '$http', '$routeParams', '$q',
|
|||
machines.push(machine);
|
||||
}
|
||||
|
||||
// Update selection
|
||||
if($routeParams.machine.indexOf(",") == -1) {
|
||||
$scope.$parent.selectedMachine = master["machines"][$routeParams.machine];
|
||||
} else {
|
||||
$scope.$parent.machines.push({
|
||||
id: $routeParams.machine,
|
||||
description: "Multipe machines",
|
||||
});
|
||||
$scope.$parent.selectedMachine = $scope.$parent.machines[$scope.$parent.machines.length-1];
|
||||
}
|
||||
|
||||
// Show date
|
||||
$scope.$parent.date = machines[0].stamp*1000;
|
||||
|
||||
|
@ -101,16 +112,20 @@ awfyCtrl.controller('overviewCtrl', ['$scope', '$http', '$routeParams', '$q',
|
|||
|
||||
// Create
|
||||
for(i in testsuites) {
|
||||
var name;
|
||||
var name, suite;
|
||||
if(!$routeParams.suite) {
|
||||
name = master["suiteversions"][i]["name"];
|
||||
suite = master["suiteversions"][i]["suite"];
|
||||
} else {
|
||||
name = i;
|
||||
suite = master["suiteversions"][$routeParams.suite]["suite"];
|
||||
}
|
||||
|
||||
var testsuite = {
|
||||
id: i,
|
||||
name: name,
|
||||
suite: suite,
|
||||
order: master["suites"][suite]["direction"],
|
||||
machines: [],
|
||||
maxScore: 0,
|
||||
};
|
||||
|
@ -140,10 +155,15 @@ awfyCtrl.controller('overviewCtrl', ['$scope', '$http', '$routeParams', '$q',
|
|||
|
||||
for(var k in machines[j]["data"][key]["scores"]) {
|
||||
var test = machines[j]["data"][key]["scores"][k];
|
||||
var score = Math.round(test["score"]*100)/100;
|
||||
|
||||
if(testsuite.order == -1) {
|
||||
score += "ms";
|
||||
}
|
||||
|
||||
machine.tests.push({
|
||||
name: master["modes"][test["modeid"]]["name"],
|
||||
score: Math.round(test["score"], 2),
|
||||
score: score,
|
||||
ff: isFF(master["modes"][test["modeid"]]["name"]) ? "ff" : "",
|
||||
});
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
// Listen on Persona events
|
||||
var request = false;
|
||||
var currentUser = decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent("persona").replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
||||
var url = window.location.href.replace(window.location.hash, "") + "../auth.php";
|
||||
navigator.id.watch({
|
||||
loggedInUser: currentUser == "" ? null : currentUser,
|
||||
onlogin: function (assertion) {
|
||||
if(request) {
|
||||
window.location = url + "?persona=1&assertion=" + assertion;
|
||||
}
|
||||
},
|
||||
onlogout: function () {
|
||||
if(request) {
|
||||
window.location = url + "?persona=1&logout=1";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Set default login
|
||||
if(currentUser) {
|
||||
$(function() {
|
||||
document.getElementById("personaLogout").style.display = "block";
|
||||
document.getElementById("personaLogin").style.display = "none";
|
||||
});
|
||||
}
|
||||
|
||||
// Do login in
|
||||
var doPersonaLogin = function() {
|
||||
request = true;
|
||||
navigator.id.request();
|
||||
}
|
||||
|
||||
// Do login out
|
||||
var doPersonaLogout = function() {
|
||||
request = true;
|
||||
navigator.id.logout();
|
||||
}
|
|
@ -43,13 +43,15 @@
|
|||
<progress ng-value='{{test.score}}' ng-attr-max='{{testsuite.maxScore}}' ng-attr-class="{{test.ff}}"></progress>
|
||||
</div>
|
||||
</div>
|
||||
<div class='legend' ng-if="testsuite.order==1">Higher is better</div>
|
||||
<div class='legend' ng-if="testsuite.order==-1">Lower is better</div>
|
||||
</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>
|
||||
<a class='history' ng-href='../#machine={{machineId}}&view=single&suite={{testsuite.suite}}'>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>
|
||||
<a class='history' ng-href='../#machine={{machineId}}&view=single&suite={{testsuite.suite}}&subtest={{testsuite.name}}'>History</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -36,6 +36,14 @@
|
|||
color: $_accent;
|
||||
}
|
||||
|
||||
.legend {
|
||||
text-align: right;
|
||||
font-size: $unit*1.5;
|
||||
text-transform: uppercase;
|
||||
margin-top: $unit*3;
|
||||
color: #AAAAAA;
|
||||
}
|
||||
|
||||
.score {
|
||||
float: right;
|
||||
font-size: 1.4em;
|
||||
|
|
Загрузка…
Ссылка в новой задаче