diff --git a/front/src/js/controllers/queueCtrl.js b/front/src/js/controllers/queueCtrl.js index 909b96f..17a3820 100644 --- a/front/src/js/controllers/queueCtrl.js +++ b/front/src/js/controllers/queueCtrl.js @@ -1,6 +1,6 @@ var queueCtrl = angular.module('queueCtrl', ['runsFactory']); -queueCtrl.controller('QueueCtrl', ['$scope', '$routeParams', '$location', 'Runs', function($scope, $routeParams, $location, Runs) { +queueCtrl.controller('QueueCtrl', ['$scope', '$routeParams', '$location', 'Runs', 'API', function($scope, $routeParams, $location, Runs, API) { $scope.runId = $routeParams.runId; var numberOfTries = 0; @@ -9,6 +9,8 @@ queueCtrl.controller('QueueCtrl', ['$scope', '$routeParams', '$location', 'Runs' Runs.get({runId: $scope.runId}, function(data) { $scope.url = data.params.url; $scope.status = data.status; + $scope.notFound = false; + $scope.connectionLost = false; if (data.status.statusCode === 'running' || data.status.statusCode === 'awaiting') { numberOfTries ++; @@ -21,6 +23,16 @@ queueCtrl.controller('QueueCtrl', ['$scope', '$routeParams', '$location', 'Runs' } else { // Handled by the view } + }, function(response) { + if (response.status === 404) { + $scope.notFound = true; + $scope.connectionLost = false; + } else if (response.status === 0) { + // Connection lost, retry in 10 seconds + setTimeout(getRunStatus, 10000); + $scope.connectionLost = true; + $scope.notFound = false; + } }); } diff --git a/front/src/views/queue.html b/front/src/views/queue.html index f2d9fb5..98bcbf7 100644 --- a/front/src/views/queue.html +++ b/front/src/views/queue.html @@ -1,24 +1,36 @@ -
Tested url: {{url}}
+Tested url: {{url}}
-{{status.error}}
+(auto-refresh activated)
+(auto-refresh activated)
+Opening results...
+The server probably rebooted. We are very sorry about that, please try to launch the test again.
- Report the issue on GitHub New test(auto-refresh activated)
-(auto-refresh activated)
-Opening results...
+Check your wifi cable, or maybe YellowLab.tools is rebooting.