Upload now has uninstall.

This commit is contained in:
Gunther Brunner
2014-04-03 23:28:32 +09:00
parent 9c27be2871
commit 760464388e
11 changed files with 110 additions and 9 deletions

View File

@@ -7,6 +7,11 @@ module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettex
}
$rootScope.install = function ($files) {
$scope.installation = {
progress: 0,
lastData: 'uploading'
}
return $rootScope.control.install($files)
.then(function (tx) {
var manifest = tx.manifest
@@ -20,13 +25,25 @@ module.exports = function UploadCtrl($scope, $rootScope, SettingsService, gettex
.then(function (result) {
$scope.$apply(function () {
result.manifest = manifest
console.log(manifest)
$scope.treeData = manifest
$scope.installation = result
})
})
})
}
$scope.uninstall = function (packageName) {
console.log('first')
var tx = $rootScope.control.uninstall(packageName)
return tx.promise.then(function (result) {
if (result.success) {
//$scope.clear()
} else {
console.error(result.error)
}
})
}
//
// $scope.installEnabled = true
// SettingsService.bind($scope, {