Add a progress bar on the UI

This commit is contained in:
Gaël Métais
2021-01-03 01:43:46 +00:00
parent 64733d55f8
commit bd9cb2e257
10 changed files with 122 additions and 10 deletions
+9 -2
View File
@@ -9,15 +9,22 @@ queueCtrl.controller('QueueCtrl', ['$scope', '$routeParams', '$location', 'Runs'
Runs.get({runId: $scope.runId}, function(data) {
$scope.url = data.params.url;
$scope.status = data.status;
$scope.progress = data.progress;
$scope.notFound = false;
$scope.connectionLost = false;
if (data.status.statusCode === 'running' || data.status.statusCode === 'awaiting') {
if (data.status.statusCode === 'awaiting') {
numberOfTries ++;
// Retrying in 2 seconds (and increasing the delay a bit more each time)
// Retrying every 2 seconds (and increasing the delay a bit more each time)
setTimeout(getRunStatus, 2000 + (numberOfTries * 100));
} else if (data.status.statusCode === 'running') {
numberOfTries ++;
// Retrying every second or so
setTimeout(getRunStatus, 1000 + (numberOfTries * 10));
} else if (data.status.statusCode === 'complete') {
$location.path('/result/' + $scope.runId).replace();
} else {