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}}

-
-
Test failed
-

{{status.error}}

+
+
+
Test failed
+

{{status.error}}

+ + Report the issue on GitHub + New test +
+
+
+ + +
+

(auto-refresh activated)

+
+
+
Test is running...
+

(auto-refresh activated)

+
+
+
Test complete
+

Opening results...

+
+
+
+
Error 404 (test not found)
+

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)

-
-
-
Test is running...
-

(auto-refresh activated)

-
-
-
Test complete
-

Opening results...

+
+
Connection lost with server
+

Check your wifi cable, or maybe YellowLab.tools is rebooting.

\ No newline at end of file