mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
37 lines
846 B
JavaScript
37 lines
846 B
JavaScript
module.exports = function InstallCtrl(
|
|
$scope
|
|
, InstallService
|
|
) {
|
|
$scope.accordionOpen = true
|
|
$scope.installation = null
|
|
|
|
$scope.clear = function() {
|
|
$scope.installation = null
|
|
$scope.accordionOpen = false
|
|
}
|
|
|
|
$scope.$on('installation', function(e, installation) {
|
|
$scope.installation = installation.apply($scope)
|
|
})
|
|
|
|
$scope.installUrl = function(url) {
|
|
return InstallService.installUrl($scope.control, url)
|
|
}
|
|
|
|
$scope.installFile = function($files) {
|
|
if ($files.length) {
|
|
return InstallService.installFile($scope.control, $files)
|
|
}
|
|
}
|
|
|
|
$scope.uninstall = function(packageName) {
|
|
// TODO: After clicking uninstall accordion opens
|
|
return $scope.control.uninstall(packageName)
|
|
.then(function() {
|
|
$scope.$apply(function() {
|
|
$scope.clear()
|
|
})
|
|
})
|
|
}
|
|
}
|