mirror of
https://github.com/openstf/stf
synced 2025-10-06 03:50:04 +02:00
Show progress for URL installation. Temporarily break upload installation.
This commit is contained in:
parent
1d2afa65b4
commit
44378e625f
9 changed files with 288 additions and 88 deletions
|
@ -1,34 +1,48 @@
|
|||
module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettext) {
|
||||
|
||||
$scope.upload = null
|
||||
$scope.installation = null
|
||||
|
||||
$scope.clear = function () {
|
||||
$scope.upload = null
|
||||
$scope.installation = null
|
||||
}
|
||||
|
||||
$rootScope.install = function ($files) {
|
||||
$scope.installation = {
|
||||
$scope.upload = {
|
||||
progress: 0,
|
||||
lastData: 'uploading'
|
||||
}
|
||||
|
||||
return $rootScope.control.install($files)
|
||||
.then(function (tx) {
|
||||
var manifest = tx.manifest
|
||||
return tx.promise
|
||||
.progressed(function (result) {
|
||||
$scope.$apply(function () {
|
||||
result.manifest = manifest
|
||||
$scope.installation = result
|
||||
var upload = $rootScope.control.upload($files)
|
||||
$scope.installation = null
|
||||
return upload.promise
|
||||
.progressed(function(uploadResult) {
|
||||
$scope.$apply(function() {
|
||||
$scope.upload = uploadResult
|
||||
})
|
||||
})
|
||||
.then(function(uploadResult) {
|
||||
$scope.$apply(function() {
|
||||
$scope.upload = uploadResult
|
||||
})
|
||||
if (uploadResult.success) {
|
||||
var install = $rootScope.control.install(uploadResult.body)
|
||||
return install.promise
|
||||
.progressed(function(installResult) {
|
||||
$scope.$apply(function() {
|
||||
installResult.manifest = uploadResult.body.manifest
|
||||
$scope.installation = installResult
|
||||
})
|
||||
})
|
||||
})
|
||||
.then(function (result) {
|
||||
$scope.$apply(function () {
|
||||
result.manifest = manifest
|
||||
$scope.treeData = manifest
|
||||
$scope.installation = result
|
||||
.then(function(installResult) {
|
||||
$scope.$apply(function() {
|
||||
installResult.manifest = uploadResult.body.manifest
|
||||
$scope.treeData = installResult.manifest
|
||||
$scope.installation = installResult
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue