Skip to content

Commit

Permalink
fixed #161
Browse files Browse the repository at this point in the history
  • Loading branch information
oshai committed May 10, 2015
1 parent d0b67eb commit d5231b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

//// JavaScript Code ////
function projectStatusCtrl($scope,$rootScope,$log,$filter,$location,SelectedNodesService,Constants,AlertService,$routeParams,ProjectsRepository) {
function projectStatusCtrl($scope,$rootScope,$log,$filter,$location,SelectedNodesService,Constants,AlertService,$routeParams,ProjectsRepository,CodeineService) {

$scope.allNodesCount = 0;
$scope.maxNodeAliasLengthForSmallCol = 30;
Expand Down Expand Up @@ -255,6 +255,19 @@
});
};

$scope.downloadNodes = function() {
CodeineService.getNodesCsv($scope.projectName).
success(function(data) {
var element = angular.element('<a/>');
element.attr({
href: 'data:attachment/csv;charset=utf-8,' + encodeURI(data),
target: '_blank',
download: 'nodes.'+$scope.projectName+'.csv'
})[0].click();

});
};

var syncWithImmutableProject = function () {

var tempVersionIsOpen = $scope.versionIsOpen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<button ng-click="refreshProjectStatus()" tooltip="refresh" class="btn btn-default navbar-btn navbar-left"><i class="fa fa-refresh"></i></button>
<button ng-click="downloadNodes()" tooltip="download nodes list in csv format" class="btn btn-default navbar-btn navbar-left"><i class="fa fa-cloud-download"></i></button>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" ng-model="nodesFilter" class="form-control search-query" placeholder="Filter Nodes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
getUserInfo : function() {
return $http.get(Constants.CODEINE_WEB_SERVER + getApiPrefix() + "/user-info", { cache: false });
},
getNodesCsv : function(project) {
return $http.get(Constants.CODEINE_WEB_SERVER + getApiPrefix() + "/csv-nodes", {params: { project: project } ,cache: false });
},
getProjectNodesAliases : function(project) {
return $http.get(Constants.CODEINE_WEB_SERVER + getApiPrefix() + "/project-nodes-aliases", {params: { project: project } ,cache: false });
},
Expand Down

0 comments on commit d5231b3

Please sign in to comment.