1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 03:50:04 +02:00

Only install if enabled.

This commit is contained in:
Gunther Brunner 2014-04-04 19:46:59 +09:00
parent 2e80900537
commit db11a59125
3 changed files with 25 additions and 19 deletions

View file

@ -1,2 +1,2 @@
div(ng-controller='ActivitiesCtrl')
h1 Activities
h3 Activities

View file

@ -2,6 +2,8 @@ module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettex
$scope.upload = null
$scope.installation = null
$scope.installEnabled = true
$scope.launchEnabled = true
$scope.clear = function () {
$scope.upload = null
@ -17,31 +19,33 @@ module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettex
var upload = $rootScope.control.upload($files)
$scope.installation = null
return upload.promise
.progressed(function(uploadResult) {
$scope.$apply(function() {
.progressed(function (uploadResult) {
$scope.$apply(function () {
$scope.upload = uploadResult
})
})
.then(function(uploadResult) {
$scope.$apply(function() {
.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
if ($scope.installEnabled) {
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(installResult) {
$scope.$apply(function() {
installResult.manifest = uploadResult.body.manifest
$scope.treeData = installResult.manifest
$scope.installation = installResult
.then(function (installResult) {
$scope.$apply(function () {
installResult.manifest = uploadResult.body.manifest
$scope.treeData = installResult.manifest
$scope.installation = installResult
})
})
})
}
}
})
}

View file

@ -7,7 +7,7 @@
input(type='checkbox', ng-model='launchEnabled', ng-disabled='true')
span Launch
label.checkbox-inline.pull-right
input(type='checkbox', ng-model='installEnabled', ng-disabled='true')
input(type='checkbox', ng-model='installEnabled')
span Install
.widget-content.padded
@ -32,6 +32,8 @@
//treecontrol.tree-classic(tree-model='treeData', options='treeOptions')
span employee: {{node.name}} age {{node.age}}
pre(ng-if='upload.error') Error: {{ upload.error }}
.upload-status(ng-if='upload && !upload.settled')
div(ng-switch='upload.lastData')