From d5231b383cbd0674359fa995883113924e245a84 Mon Sep 17 00:00:00 2001 From: oshai Date: Sun, 10 May 2015 13:02:17 +0300 Subject: [PATCH] fixed #161 --- .../project_status/projectStatusCtrl.js | 15 ++++++++++++++- .../components/project_status/project_status.html | 1 + .../ajs/app/components/services/codeineService.js | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/deployment/http-root/ajs/app/components/project_status/projectStatusCtrl.js b/deployment/http-root/ajs/app/components/project_status/projectStatusCtrl.js index af27b7f4..74e9734c 100644 --- a/deployment/http-root/ajs/app/components/project_status/projectStatusCtrl.js +++ b/deployment/http-root/ajs/app/components/project_status/projectStatusCtrl.js @@ -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; @@ -255,6 +255,19 @@ }); }; + $scope.downloadNodes = function() { + CodeineService.getNodesCsv($scope.projectName). + success(function(data) { + var element = angular.element(''); + 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; diff --git a/deployment/http-root/ajs/app/components/project_status/project_status.html b/deployment/http-root/ajs/app/components/project_status/project_status.html index a3e21c13..66767e6e 100644 --- a/deployment/http-root/ajs/app/components/project_status/project_status.html +++ b/deployment/http-root/ajs/app/components/project_status/project_status.html @@ -16,6 +16,7 @@