1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 03:50:04 +02:00
OpenSTF/res/app/control-panes/dashboard/upload/upload-controller.js
2014-04-03 19:55:47 +09:00

51 lines
1.3 KiB
JavaScript

module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettext) {
$scope.installation = null
$scope.clear = function () {
$scope.installation = null
}
$rootScope.install = function ($files) {
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
})
})
.then(function (result) {
$scope.$apply(function () {
result.manifest = manifest
$scope.installation = result
})
})
})
}
$scope.progressMessage = function (code) {
return {
'pushing_app': gettext('Pushing app...'),
'installing_app': gettext('Installing app...'),
'launching_app': gettext('Launching activity...'),
'success': gettext('Installation complete'),
'fail': gettext('Installation failed')
}[code]
}
//
// $scope.installEnabled = true
// SettingsService.bind($scope, {
// key: 'installEnabled',
// storeName: 'Upload'
// })
//
// //$scope.launchEnabled = true
// SettingsService.bind($scope, {
// key: 'launchEnabled',
// storeName: 'Upload'
// })
}