From 7c441caab5bae6ad6dc43f16b56993563cf3a7bc Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Fri, 22 Jul 2016 09:57:11 +0200 Subject: [PATCH 01/55] fix: disable checkbox Started working on issue #12, multiple deleted does not work because it is not implemented in NFVO it seems, disabled it for now --- src/main/resources/static/js/controllers/indexController.js | 2 +- src/main/resources/static/pages/projects.html | 6 +++--- src/main/resources/static/pages/users/users.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/js/controllers/indexController.js b/src/main/resources/static/js/controllers/indexController.js index 06a228c..82dca72 100644 --- a/src/main/resources/static/js/controllers/indexController.js +++ b/src/main/resources/static/js/controllers/indexController.js @@ -8,7 +8,7 @@ var app = angular.module('app'); app.controller('LoginController', function ($scope, AuthService, Session, $rootScope, $location, $cookieStore, $http, $window) { $scope.currentUser = null; - //$scope.URL = 'http://lore:8080'; + //$scope.URL = 'http://localhost:8080'; //$scope.URL = 'http://192.168.161.6:8080'; $scope.URL = ''; $scope.credential = { diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index 48aac26..3640c39 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -35,7 +35,7 @@

class="table table-bordered table-striped table-hover tablesorter"> - + Id name Actions @@ -43,7 +43,7 @@

- + {{data.id}} {{data.name}} @@ -116,4 +116,4 @@

- \ No newline at end of file + diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index 4394bcd..d051931 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -35,7 +35,7 @@

class="table table-bordered table-striped table-hover tablesorter"> - + Id username enabled @@ -45,7 +45,7 @@

- + {{data.id}} {{data.username}} {{data.enabled}} From cc7c779590b996a2317f75411ef31b843f731fd6 Mon Sep 17 00:00:00 2001 From: oleksandr gozman Date: Fri, 22 Jul 2016 13:21:22 +0200 Subject: [PATCH 02/55] fix: reworked delete button In the projects page now deleted action button->delete button, no drop down menu, disabled if you are in are in the project --- .../resources/static/js/controllers/indexController.js | 2 +- src/main/resources/static/pages/projects.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/static/js/controllers/indexController.js b/src/main/resources/static/js/controllers/indexController.js index 82dca72..06a228c 100644 --- a/src/main/resources/static/js/controllers/indexController.js +++ b/src/main/resources/static/js/controllers/indexController.js @@ -8,7 +8,7 @@ var app = angular.module('app'); app.controller('LoginController', function ($scope, AuthService, Session, $rootScope, $location, $cookieStore, $http, $window) { $scope.currentUser = null; - //$scope.URL = 'http://localhost:8080'; + //$scope.URL = 'http://lore:8080'; //$scope.URL = 'http://192.168.161.6:8080'; $scope.URL = ''; $scope.credential = { diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index 3640c39..aa66c47 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -49,11 +49,11 @@

{{data.name}}
- -
From 8fab66f1db51aa4df1d8d6ce63a54f026f40a454 Mon Sep 17 00:00:00 2001 From: oleksandr gozman Date: Fri, 22 Jul 2016 14:35:50 +0200 Subject: [PATCH 03/55] fix: brought back the checkboxes Multiple delete methods implemented, so the checkboxes in users in projects are now back --- src/main/resources/static/pages/projects.html | 6 +++--- src/main/resources/static/pages/users/users.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index aa66c47..ae97e87 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -35,7 +35,7 @@

class="table table-bordered table-striped table-hover tablesorter"> - + Id name Actions @@ -43,13 +43,13 @@

- + {{data.id}} {{data.name}}
- + Id username enabled @@ -45,7 +45,7 @@

- + {{data.id}} {{data.username}} {{data.enabled}} From 00175dd9071f7b5685df2fb55328ccdf50db5169 Mon Sep 17 00:00:00 2001 From: oleksandr gozman Date: Fri, 22 Jul 2016 16:29:19 +0200 Subject: [PATCH 04/55] imp: button changes Disabled delete button on admin user --- .../resources/static/js/controllers/indexController.js | 2 +- src/main/resources/static/pages/users/users.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/static/js/controllers/indexController.js b/src/main/resources/static/js/controllers/indexController.js index 06a228c..82dca72 100644 --- a/src/main/resources/static/js/controllers/indexController.js +++ b/src/main/resources/static/js/controllers/indexController.js @@ -8,7 +8,7 @@ var app = angular.module('app'); app.controller('LoginController', function ($scope, AuthService, Session, $rootScope, $location, $cookieStore, $http, $window) { $scope.currentUser = null; - //$scope.URL = 'http://lore:8080'; + //$scope.URL = 'http://localhost:8080'; //$scope.URL = 'http://192.168.161.6:8080'; $scope.URL = ''; $scope.credential = { diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index 4394bcd..fdfc75c 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -52,11 +52,11 @@

project: {{role.project}}, role: {{role.role}};
- -
From 38aab21b8effd67e62a9c3e5924dadf6f7e9a628 Mon Sep 17 00:00:00 2001 From: oleksandr gozman Date: Mon, 25 Jul 2016 13:51:56 +0200 Subject: [PATCH 05/55] imp: disable the menus for nonadmin The GUI now check for admin and disables more tabs and buttons if the user is not admin --- .../resources/static/js/controllers/indexController.js | 8 ++++++++ .../resources/static/js/controllers/projectController.js | 9 +++++++++ .../resources/static/js/controllers/userController.js | 7 ++----- src/main/resources/static/menu.html | 4 ++-- src/main/resources/static/pages/projects.html | 4 ++-- src/main/resources/static/pages/users/users.html | 2 +- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/main/resources/static/js/controllers/indexController.js b/src/main/resources/static/js/controllers/indexController.js index 82dca72..d1717ed 100644 --- a/src/main/resources/static/js/controllers/indexController.js +++ b/src/main/resources/static/js/controllers/indexController.js @@ -272,6 +272,14 @@ app.controller('IndexCtrl', function ($scope, $compile, $routeParams, serviceAPI } }; + $scope.admin = function() { + //console.log($cookieStore.get('userName')); + if($cookieStore.get('userName') === 'admin') { + return true; + } else { + return false; + } + }; }); diff --git a/src/main/resources/static/js/controllers/projectController.js b/src/main/resources/static/js/controllers/projectController.js index ff4a980..e23202c 100644 --- a/src/main/resources/static/js/controllers/projectController.js +++ b/src/main/resources/static/js/controllers/projectController.js @@ -130,4 +130,13 @@ app.controller('ProjectCtrl', function ($scope, serviceAPI, $routeParams, http, $('.modal').modal('hide'); } + $scope.admin = function() { + //console.log($cookieStore.get('userName')); + if($cookieStore.get('userName') === 'admin') { + return true; + } else { + return false; + } + }; + }); diff --git a/src/main/resources/static/js/controllers/userController.js b/src/main/resources/static/js/controllers/userController.js index 5abfbe9..0ab3cab 100644 --- a/src/main/resources/static/js/controllers/userController.js +++ b/src/main/resources/static/js/controllers/userController.js @@ -3,9 +3,7 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co var url = $cookieStore.get('URL') + "/api/v1/users/"; var urlprojects = $cookieStore.get('URL') + "/api/v1/projects/"; - //$scope.URL = 'http://lore:8080'; - //var url = "http://lore:8080/api/v1/users/"; - //var urlprojects = "http://lore:8080/api/v1/projects/"; + $scope.alerts = []; $scope.closeAlert = function (index) { $scope.alerts.splice(index, 1); @@ -59,8 +57,7 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co "enabled": true, "roles": [ { - "role": "GUEST", - "project": "*" + } ] }; diff --git a/src/main/resources/static/menu.html b/src/main/resources/static/menu.html index 51f55f5..d662561 100644 --- a/src/main/resources/static/menu.html +++ b/src/main/resources/static/menu.html @@ -109,7 +109,7 @@
  • Projects
  • -
  • +
  • Users
  • @@ -221,7 +221,7 @@

    - +
    diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index ae97e87..cf5eb54 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -14,11 +14,11 @@

    - diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index fdfc75c..f277a1c 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -35,7 +35,7 @@

    class="table table-bordered table-striped table-hover tablesorter"> - + Id username enabled From 6e39f2ad1dcb2ab96e0af444c4f8584a38e57d9b Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Tue, 26 Jul 2016 10:46:46 +0200 Subject: [PATCH 06/55] imp: changes to management Changed multiple delete policy and disabled marks --- .../static/js/controllers/indexController.js | 2 +- .../static/js/controllers/projectController.js | 10 ++++++++++ .../static/js/controllers/userController.js | 13 +++++++++++-- src/main/resources/static/pages/projects.html | 2 +- src/main/resources/static/pages/users/users.html | 4 ++-- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/js/controllers/indexController.js b/src/main/resources/static/js/controllers/indexController.js index d1717ed..43c72f8 100644 --- a/src/main/resources/static/js/controllers/indexController.js +++ b/src/main/resources/static/js/controllers/indexController.js @@ -8,7 +8,7 @@ var app = angular.module('app'); app.controller('LoginController', function ($scope, AuthService, Session, $rootScope, $location, $cookieStore, $http, $window) { $scope.currentUser = null; - //$scope.URL = 'http://localhost:8080'; + //$scope.URL = 'http://localhsot:8080'; //$scope.URL = 'http://192.168.161.6:8080'; $scope.URL = ''; $scope.credential = { diff --git a/src/main/resources/static/js/controllers/projectController.js b/src/main/resources/static/js/controllers/projectController.js index e23202c..78031fa 100644 --- a/src/main/resources/static/js/controllers/projectController.js +++ b/src/main/resources/static/js/controllers/projectController.js @@ -40,6 +40,9 @@ app.controller('ProjectCtrl', function ($scope, serviceAPI, $routeParams, http, ////console.log(newValue.checkbox); ////console.log($scope.selection.ids); angular.forEach($scope.selection.ids, function (value, k) { + if (k === $scope.defaultID) { + return; + } $scope.selection.ids[k] = newValue.checkbox; }); //console.log($scope.selection.ids); @@ -101,11 +104,18 @@ app.controller('ProjectCtrl', function ($scope, serviceAPI, $routeParams, http, showError(response, status); }); }; + $scope.defaultID = ""; function loadTable() { http.get(url) .success(function (response) { $scope.projects = response; //console.log(response); + for (i = 0; i < $scope.projects.length; i++) { + if ($scope.projects[i].name === 'default') { + $scope.defaultID = $scope.projects[i].id; + } + } + //console.log($scope.defaultID); }) .error(function (data, status) { showError(data, status); diff --git a/src/main/resources/static/js/controllers/userController.js b/src/main/resources/static/js/controllers/userController.js index 0ab3cab..193ebc5 100644 --- a/src/main/resources/static/js/controllers/userController.js +++ b/src/main/resources/static/js/controllers/userController.js @@ -88,9 +88,11 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co ////console.log(newValue.checkbox); ////console.log($scope.selection.ids); angular.forEach($scope.selection.ids, function (value, k) { + if (k === $scope.adminID) { + return; + } $scope.selection.ids[k] = newValue.checkbox; }); - //console.log($scope.selection.ids); }, true); $scope.$watch('selection', function (newValue, oldValue) { @@ -162,7 +164,14 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co http.get(url) .success(function (response) { $scope.users = response; - //console.log(response); + //console.log($scope.users.length); + for (i = 0; i < $scope.users.length; i++) { + if ($scope.users[i].username === 'admin') { + $scope.adminID = $scope.users[i].id; + } + } + //console.log($scope.adminID); + }) .error(function (data, status) { showError(data, status); diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index cf5eb54..88f69ce 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -43,7 +43,7 @@

    - + {{data.id}} {{data.name}} diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index f277a1c..2fa8557 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -35,7 +35,7 @@

    class="table table-bordered table-striped table-hover tablesorter"> - + Id username enabled @@ -45,7 +45,7 @@

    - + {{data.id}} {{data.username}} {{data.enabled}} From d882496816af0039716924cdde4984c7cafc87d5 Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Tue, 26 Jul 2016 11:10:45 +0200 Subject: [PATCH 07/55] fix: Readded the default roles If there are now default roles assigned it is possible to break NFVO via creating user without a role, i have added the default roles back to avoid this kind of behaviour --- src/main/resources/static/js/controllers/userController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/controllers/userController.js b/src/main/resources/static/js/controllers/userController.js index 193ebc5..0c91f40 100644 --- a/src/main/resources/static/js/controllers/userController.js +++ b/src/main/resources/static/js/controllers/userController.js @@ -57,7 +57,8 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co "enabled": true, "roles": [ { - + "role": "GUEST", + "project": "*" } ] }; From 1912c6f08ae3d06e7e5ab0249ce4eb63875a53b9 Mon Sep 17 00:00:00 2001 From: oleksandr gozman Date: Mon, 1 Aug 2016 13:54:24 +0200 Subject: [PATCH 08/55] imp: update user Started working on the function to update the user from GUI --- .../static/js/controllers/userController.js | 16 ++++ .../resources/static/pages/users/users.html | 81 ++++++++++++++++++- 2 files changed, 93 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/js/controllers/userController.js b/src/main/resources/static/js/controllers/userController.js index 0c91f40..aadaaf1 100644 --- a/src/main/resources/static/js/controllers/userController.js +++ b/src/main/resources/static/js/controllers/userController.js @@ -28,6 +28,14 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co }; $scope.userObj.roles.push(newRole); }; + $scope.addRoleUpdate = function() { + var newRole = { + "role": "GUEST", + "project": "*" + }; + $scope.userUpdate.roles.push(newRole); + }; + $scope.loadCurrentUser = function(){ http.get(url +'current') @@ -116,6 +124,7 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co }, true); $scope.multipleDelete = true; + $scope.userUpdate = ""; $scope.selection = {}; $scope.selection.ids = {}; @@ -149,6 +158,12 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co showError(response, status); }); }; + + $scope.update = function(data) { + $scope.userUpdate = JSON.parse(JSON.stringify(data));; + console.log(data); + }; + function loadTable() { //console.log($routeParams.userId); if (!angular.isUndefined($routeParams.userId)) @@ -201,4 +216,5 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co $('.modal').modal('hide'); } + }); diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index 2fa8557..0def177 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -52,11 +52,12 @@

    project: {{role.project}}, role: {{role.role}};
    - - +
    @@ -140,6 +141,78 @@

    Role
  • + + From ed887377c6aed0c8ef691cec20128a2d0221e1f7 Mon Sep 17 00:00:00 2001 From: oleksandr gozman Date: Mon, 1 Aug 2016 14:52:38 +0200 Subject: [PATCH 10/55] imp: made button prettier --- src/main/resources/static/js/controllers/userController.js | 6 +++--- src/main/resources/static/pages/users/users.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/js/controllers/userController.js b/src/main/resources/static/js/controllers/userController.js index 626bedc..1275e07 100644 --- a/src/main/resources/static/js/controllers/userController.js +++ b/src/main/resources/static/js/controllers/userController.js @@ -216,7 +216,7 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co $('.modal').modal('hide'); } $scope.updateSave = function () { - console.log($scope.userUpdate); + //console.log($scope.userUpdate); updateObj = {}; updateObj.username = $scope.userUpdate.username; updateObj.password = $scope.userUpdate.password; @@ -229,8 +229,8 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co }; updateObj.roles.push(newRole); } - console.log("Copied"); - console.log(updateObj); + //console.log("Copied"); + //console.log(updateObj); http.put(url + updateObj.username, updateObj) .success(function (response) { showOk('Project: ' + $scope.userObj.name + ' saved.'); diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index 2bb72f6..8622af5 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -52,7 +52,7 @@

    project: {{role.project}}, role: {{role.role}};
    -

    - +
    +
    + + +
    + +
    +
    -
  • - Identity + Identity diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index 88f69ce..cf5eb54 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -43,7 +43,7 @@

    - + {{data.id}} {{data.name}} diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index 43267d4..bc5d238 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -45,7 +45,7 @@

    - + {{data.id}} {{data.username}} {{data.enabled}} From 174791c0b00e2ed726b8616ba9a194b04a29a1bf Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Tue, 2 Aug 2016 11:54:45 +0200 Subject: [PATCH 14/55] imp: changed identity tab Disabled the action button on the logged in admin user --- src/main/resources/static/js/controllers/indexController.js | 5 +++-- src/main/resources/static/pages/users/users.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/resources/static/js/controllers/indexController.js b/src/main/resources/static/js/controllers/indexController.js index a745cfa..8535ae3 100644 --- a/src/main/resources/static/js/controllers/indexController.js +++ b/src/main/resources/static/js/controllers/indexController.js @@ -102,7 +102,8 @@ app.controller('LoginController', function ($scope, AuthService, Session, $rootS app.controller('IndexCtrl', function ($scope, $compile, $routeParams, serviceAPI, $interval, $cookieStore, $location, AuthService, http, $rootScope, $window) { $('#side-menu').metisMenu(); - + $scope.adminRole = "OB_ADMIN"; + $scope.superProject = "*"; var url = $cookieStore.get('URL') + "/api/v1"; $scope.config = {}; @@ -288,7 +289,7 @@ app.controller('IndexCtrl', function ($scope, $compile, $routeParams, serviceAPI $scope.admin = function() { console.log($scope.userLogged); - if($scope.userLogged.roles[0].project === '*' && $scope.userLogged.roles[0].role === "OB_ADMIN") { + if($scope.userLogged.roles[0].project === $scope.superProject && $scope.userLogged.roles[0].role === $scope.adminRole) { return true; } else { return false; diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index bc5d238..da1e783 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -52,7 +52,7 @@

    project: {{role.project}}, role: {{role.role}};
    -
    @@ -140,6 +141,78 @@

    Role
  • + + From 6796b68208bb7579744f7540b2a06199f63cc7b1 Mon Sep 17 00:00:00 2001 From: oleksandr gozman Date: Mon, 1 Aug 2016 14:52:38 +0200 Subject: [PATCH 27/55] imp: made button prettier --- src/main/resources/static/js/controllers/userController.js | 6 +++--- src/main/resources/static/pages/users/users.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/js/controllers/userController.js b/src/main/resources/static/js/controllers/userController.js index 626bedc..1275e07 100644 --- a/src/main/resources/static/js/controllers/userController.js +++ b/src/main/resources/static/js/controllers/userController.js @@ -216,7 +216,7 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co $('.modal').modal('hide'); } $scope.updateSave = function () { - console.log($scope.userUpdate); + //console.log($scope.userUpdate); updateObj = {}; updateObj.username = $scope.userUpdate.username; updateObj.password = $scope.userUpdate.password; @@ -229,8 +229,8 @@ app.controller('UserCtrl', function ($scope, serviceAPI, $routeParams, http, $co }; updateObj.roles.push(newRole); } - console.log("Copied"); - console.log(updateObj); + //console.log("Copied"); + //console.log(updateObj); http.put(url + updateObj.username, updateObj) .success(function (response) { showOk('Project: ' + $scope.userObj.name + ' saved.'); diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index 2bb72f6..8622af5 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -52,7 +52,7 @@

    project: {{role.project}}, role: {{role.role}};
    -

    - +
    +
    + + +
    + +
    +
  • -
  • - Identity + Identity diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index 88f69ce..cf5eb54 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -43,7 +43,7 @@

    - + {{data.id}} {{data.name}} diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index 43267d4..bc5d238 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -45,7 +45,7 @@

    - + {{data.id}} {{data.username}} {{data.enabled}} From aa17aa449cd5a9a781ab57e98a47a6297e0829ff Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Tue, 2 Aug 2016 11:54:45 +0200 Subject: [PATCH 31/55] imp: changed identity tab Disabled the action button on the logged in admin user --- src/main/resources/static/js/controllers/indexController.js | 5 +++-- src/main/resources/static/pages/users/users.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/resources/static/js/controllers/indexController.js b/src/main/resources/static/js/controllers/indexController.js index a745cfa..8535ae3 100644 --- a/src/main/resources/static/js/controllers/indexController.js +++ b/src/main/resources/static/js/controllers/indexController.js @@ -102,7 +102,8 @@ app.controller('LoginController', function ($scope, AuthService, Session, $rootS app.controller('IndexCtrl', function ($scope, $compile, $routeParams, serviceAPI, $interval, $cookieStore, $location, AuthService, http, $rootScope, $window) { $('#side-menu').metisMenu(); - + $scope.adminRole = "OB_ADMIN"; + $scope.superProject = "*"; var url = $cookieStore.get('URL') + "/api/v1"; $scope.config = {}; @@ -288,7 +289,7 @@ app.controller('IndexCtrl', function ($scope, $compile, $routeParams, serviceAPI $scope.admin = function() { console.log($scope.userLogged); - if($scope.userLogged.roles[0].project === '*' && $scope.userLogged.roles[0].role === "OB_ADMIN") { + if($scope.userLogged.roles[0].project === $scope.superProject && $scope.userLogged.roles[0].role === $scope.adminRole) { return true; } else { return false; diff --git a/src/main/resources/static/pages/users/users.html b/src/main/resources/static/pages/users/users.html index bc5d238..da1e783 100644 --- a/src/main/resources/static/pages/users/users.html +++ b/src/main/resources/static/pages/users/users.html @@ -52,7 +52,7 @@

    project: {{role.project}}, role: {{role.role}};
    -

  • diff --git a/src/main/resources/static/pages/keypairs/keypairs.html b/src/main/resources/static/pages/keypairs/keypairs.html new file mode 100644 index 0000000..9f0705c --- /dev/null +++ b/src/main/resources/static/pages/keypairs/keypairs.html @@ -0,0 +1,133 @@ +
    +
    +

    + Key Pairs + List of key pairs +

    + +
    +
    +
    +
    + + + +
    +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + +
    Id Name Actions
    {{data.id}}{{data.name}} +
    + + +
    +
    +
    +
    + +
    + + + + + + + + diff --git a/src/main/resources/static/pages/nsdescriptors/nsdescriptors.html b/src/main/resources/static/pages/nsdescriptors/nsdescriptors.html index 3c4553f..c0a5427 100644 --- a/src/main/resources/static/pages/nsdescriptors/nsdescriptors.html +++ b/src/main/resources/static/pages/nsdescriptors/nsdescriptors.html @@ -63,12 +63,14 @@

    {{nsd.name}} {{nsd.vendor}} {{nsd.version}} +

    - \ No newline at end of file + + diff --git a/src/main/resources/static/pages/nsrecords/nsrecords.html b/src/main/resources/static/pages/nsrecords/nsrecords.html index 64e6492..8030cc1 100644 --- a/src/main/resources/static/pages/nsrecords/nsrecords.html +++ b/src/main/resources/static/pages/nsrecords/nsrecords.html @@ -35,6 +35,7 @@

    Id NSR Name State + Created at Actions @@ -45,6 +46,7 @@

    href="#nsrecords/{{data.id}}">{{data.id}} {{data.name}} {{data.status}} + {{data.createdAt}}
    @@ -797,4 +799,4 @@
    - \ No newline at end of file + diff --git a/src/main/resources/static/pages/projects.html b/src/main/resources/static/pages/projects.html index cfb751c..2d6b3ec 100644 --- a/src/main/resources/static/pages/projects.html +++ b/src/main/resources/static/pages/projects.html @@ -14,11 +14,11 @@

    - From 555e1b6c2a15c91b8a1367e03691c5ff85a1ba3b Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Thu, 11 Aug 2016 21:56:41 +0200 Subject: [PATCH 53/55] imp: changed save file to .pem --- .../resources/static/js/controllers/keyPairsController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/static/js/controllers/keyPairsController.js b/src/main/resources/static/js/controllers/keyPairsController.js index 9068ef5..2ef7e01 100644 --- a/src/main/resources/static/js/controllers/keyPairsController.js +++ b/src/main/resources/static/js/controllers/keyPairsController.js @@ -68,8 +68,8 @@ app.controller('keyPairsCtrl', function ($scope, serviceAPI, $routeParams, http, .success(function (response) { showOk('Key: ' + $scope.createKeyName + ' generated.'); setTimeout(loadTable(),250); - console.log(response); - document.location = 'data:Application/octet-stream,' + + //console.log(response); + document.location = 'data:application/x-pem-file,' + encodeURIComponent(response); //location.reload(); }) From a62add6d349a99c9ab6d8d56ca25ed99a58b0788 Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Thu, 11 Aug 2016 22:34:21 +0200 Subject: [PATCH 54/55] imp: save .pem as key with name --- .../resources/static/js/controllers/keyPairsController.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/resources/static/js/controllers/keyPairsController.js b/src/main/resources/static/js/controllers/keyPairsController.js index 2ef7e01..818f25a 100644 --- a/src/main/resources/static/js/controllers/keyPairsController.js +++ b/src/main/resources/static/js/controllers/keyPairsController.js @@ -69,8 +69,12 @@ app.controller('keyPairsCtrl', function ($scope, serviceAPI, $routeParams, http, showOk('Key: ' + $scope.createKeyName + ' generated.'); setTimeout(loadTable(),250); //console.log(response); - document.location = 'data:application/x-pem-file,' + - encodeURIComponent(response); + var key = document.createElement("a"); + key.download = $scope.createKeyName + '.pem'; + key.href = 'data:application/x-pem-file,' + encodeURIComponent(response); + key.click(); + //document.location = 'title: key.pem, data:application/x-pem-file,' + + // encodeURIComponent(response); //location.reload(); }) .error(function (response, status) { From d9c51cd57a94ea80b23bf128f84db4d8345621f8 Mon Sep 17 00:00:00 2001 From: Oleksandr Gozman Date: Thu, 11 Aug 2016 23:17:10 +0200 Subject: [PATCH 55/55] fix: should work on mozilla now --- .../resources/static/js/controllers/keyPairsController.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/controllers/keyPairsController.js b/src/main/resources/static/js/controllers/keyPairsController.js index 818f25a..fb75dfc 100644 --- a/src/main/resources/static/js/controllers/keyPairsController.js +++ b/src/main/resources/static/js/controllers/keyPairsController.js @@ -72,7 +72,10 @@ app.controller('keyPairsCtrl', function ($scope, serviceAPI, $routeParams, http, var key = document.createElement("a"); key.download = $scope.createKeyName + '.pem'; key.href = 'data:application/x-pem-file,' + encodeURIComponent(response); - key.click(); + document.body.appendChild(key); + key.click() + document.body.removeChild(key); + delete key; //document.location = 'title: key.pem, data:application/x-pem-file,' + // encodeURIComponent(response); //location.reload();