Download client configuration when script link is clicked
diff --git a/views/ngXosViews/vpnDashboard/src/js/main.js b/views/ngXosViews/vpnDashboard/src/js/main.js
index 4923b1c..ab6fe72 100644
--- a/views/ngXosViews/vpnDashboard/src/js/main.js
+++ b/views/ngXosViews/vpnDashboard/src/js/main.js
@@ -12,6 +12,10 @@
   .state('vpn-list', {
     url: '/',
     template: '<vpn-list></vpn-list>'
+  })
+  .state('cleint-script', {
+    url: '/client/:pk',
+    template: '<client-script></client-script>'
   });
 })
 .service('Vpn', function($http, $q){
@@ -28,6 +32,19 @@
     });
 
     return deferred.promise;
+  }
+  this.getVpnTenants = (pk) => {
+    let deferred = $q.defer();
+
+    $http.get('/xoslib/clientscript/', {params: {pk: pk}})
+    .then((res) => {
+      deferred.resolve(res.data)
+    })
+    .catch((e) => {
+      deferred.reject(e);
+    });
+
+    return deferred.promise;
   };
 })
 .config(function($httpProvider){
@@ -43,7 +60,7 @@
     controller: function(Vpn){
       // retrieving user list
       Vpn.getVpnTenants()
-      .then((vpns) => {
+      .then(vpns) => {
         this.vpns = vpns;
       })
       .catch((e) => {
@@ -51,4 +68,25 @@
       });
     }
   };
+})
+.directive('clientScript', function(){
+  return {
+    restrict: 'E',
+    scope: {
+      pk: '=pk',
+    },
+    bindToController: true,
+    controllerAs: 'vm',
+    templateUrl: 'templates/client-script.tpl.html',
+    controller: function(Vpn){
+      // retrieving user list
+      Vpn.getClientScript(pk)
+      .then(script_location) => {
+        this.script_location = script_location;
+      })
+      .catch((e) => {
+        throw new Error(e);
+      });
+    }
+  };
 });