Enhancing index, view and dashboard ui

This commit is contained in:
achrafbenyounes
2014-12-18 18:02:39 +01:00
parent d712eb3a59
commit c4a7b1f129
23 changed files with 2122 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
var queueCtrl = angular.module('queueCtrl', ['runsFactory']);
queueCtrl.controller('QueueCtrl', ['$scope', '$routeParams', '$location', 'Runs', function($scope, $routeParams, $location, Runs) {
$scope.runId = $routeParams.runId;
function getRunStatus () {
Runs.get({runId: $scope.runId}, function(data) {
$scope.status = data.status;
if (data.status.statusCode === 'running' || data.status.statusCode === 'awaiting') {
// Retrying in 2 seconds
setTimeout(getRunStatus, 2000);
} else if (data.status.statusCode === 'complete') {
$location.path('/result/' + $scope.runId);
} else {
// Handled by the view
}
});
}
getRunStatus();
}]);