diff --git a/res/app/control-panes/dashboard/upload/upload-controller.js b/res/app/control-panes/dashboard/upload/upload-controller.js index 821c2996..5997a4bf 100644 --- a/res/app/control-panes/dashboard/upload/upload-controller.js +++ b/res/app/control-panes/dashboard/upload/upload-controller.js @@ -98,34 +98,22 @@ module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettex return false } - $scope.taskProgressMax = function () { - return $scope.taskProgressMaxDivisor() * 100 - } - - $scope.taskProgressMaxDivisor = function () { - if ($scope.installEnabled) { - return 2 - } else { - return 1 - } - } - $scope.taskProgress = function () { + var progress = 0 if ($scope.installEnabled) { - var sum = 0 if ($scope.upload) { - sum += $scope.upload.progress + progress += $scope.upload.progress } if ($scope.installation) { - sum += $scope.installation.progress + progress += $scope.installation.progress } - return sum + progress = Math.floor(progress / 2) } else { if ($scope.upload) { - return $scope.upload.progress + progress = $scope.upload.progress } } - return 0 + return progress } // diff --git a/res/app/control-panes/dashboard/upload/upload.jade b/res/app/control-panes/dashboard/upload/upload.jade index e9ef6498..c4a9aac8 100644 --- a/res/app/control-panes/dashboard/upload/upload.jade +++ b/res/app/control-panes/dashboard/upload/upload.jade @@ -2,7 +2,7 @@ .heading i.fa.fa-upload span(translate) Upload - clear-button(ng-click='clear()', ng-disabled='!installation').btn-xs + clear-button(ng-click='clear()', ng-disabled='!installation && !upload').btn-xs label.checkbox-inline.pull-right input(type='checkbox', ng-model='launchEnabled', ng-disabled='true') span Launch @@ -72,7 +72,7 @@ strong(ng-switch-when='fail') span(translate) Upload failed strong(ng-switch-when='success') - span(translate) Upload complete + span(ng-show='!installation', translate) Upload complete span(ng-switch='installation.lastData') strong(ng-switch-when='pushing_app') @@ -93,7 +93,7 @@ strong(ng-switch-when='fail') span(translate) Installation failed - span(ng-hide='taskFinished()') ({{taskProgress()/taskProgressMaxDivisor()}}%) + span(ng-hide='taskFinished()') ({{taskProgress()}}%) - progressbar(max='taskProgressMax()', value='taskProgress()', ng-if='!taskFinished()', - ng-class='{"active": taskFinished()}').progress-striped + progressbar(max='100', value='taskProgress()', ng-if='!taskFinished()', + ng-class='{"active": !taskFinished()}').progress-striped