mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-26 18:55:15 +02:00
Only install if enabled.
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
div(ng-controller='ActivitiesCtrl')
|
||||
h1 Activities
|
||||
h3 Activities
|
||||
|
||||
@@ -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
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user