Add ability to download the build pack
This commit is contained in:
parent
bc0d51656a
commit
509ba2f4f7
2 changed files with 11 additions and 0 deletions
|
@ -793,6 +793,11 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
|
|||
}, 10);
|
||||
};
|
||||
|
||||
$scope.downloadForUser = function() {
|
||||
var blob = $scope.zip.generate({type:"blob"});
|
||||
saveAs(blob, $scope.repobuild['display_name'] + '.zip');
|
||||
};
|
||||
|
||||
var processBuildPack = function(response) {
|
||||
// Try to load as a zip file.
|
||||
var zipFiles = null;
|
||||
|
@ -813,6 +818,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
|
|||
}
|
||||
|
||||
// Build the zip file tree.
|
||||
$scope.zip = zip;
|
||||
$scope.tree = new FileTree(Object.keys(zipFiles));
|
||||
$($scope.tree).bind('fileClicked', function(e) {
|
||||
var file = zip.file(e.path);
|
||||
|
|
Reference in a new issue