From 462340084508d7c79685bdb04e87bed41010a1b6 Mon Sep 17 00:00:00 2001 From: seshukm Date: Tue, 25 Apr 2017 17:48:03 +0530 Subject: [PATCH] Overlay VPN page correction IssueId : CLIENT-202 Change-Id: Iea28a285d86a3ee28f9ec453c9f6e0681776f2a0 Signed-off-by: seshukm --- .../src/main/webapp/lifecyclemgr/css/style.css | 20 +++- .../src/main/webapp/lifecyclemgr/index.html | 2 +- .../src/main/webapp/lifecyclemgr/js/DataService.js | 59 ++++++++++- .../src/main/webapp/lifecyclemgr/js/app.js | 110 ++++++++++++++++++--- .../webapp/lifecyclemgr/templates/overlayTabs.html | 36 +++++++ .../webapp/lifecyclemgr/templates/overlayVPN.html | 38 ++++--- .../webapp/lifecyclemgr/templates/siteList.html | 45 +++++++++ .../lifecyclemgr/templates/underlayVPN_L2.html | 78 +++++++++++++++ .../lifecyclemgr/templates/underlayVPN_L3.html | 78 +++++++++++++++ .../webapp/lifecyclemgr/templates/vpcList.html | 45 +++++++++ .../lifecyclemgr/templates/vpnConnections.html | 60 +++++++++++ .../webapp/lifecyclemgr/templates/vpnGateway.html | 58 +++++++++++ 12 files changed, 589 insertions(+), 40 deletions(-) create mode 100644 lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayTabs.html create mode 100644 lifecyclemgr/src/main/webapp/lifecyclemgr/templates/siteList.html create mode 100644 lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L2.html create mode 100644 lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L3.html create mode 100644 lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpcList.html create mode 100644 lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnConnections.html create mode 100644 lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnGateway.html diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/css/style.css b/lifecyclemgr/src/main/webapp/lifecyclemgr/css/style.css index 954ad091..aeab8761 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/css/style.css +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/css/style.css @@ -12,7 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + +.containerh{ + background-color:white !important; + min-height:900px !important; +} + .lcmanager{ padding: 0 50px; } @@ -74,7 +79,7 @@ text-align: left; } -.detailinfo, .topo, .inputdata { +.detailinfo, .topo, .inputdata, .vpnConnections, .vpnGateway, .siteList, .vpcList { border-right: 1px solid #ddd; } @@ -194,4 +199,13 @@ select { background-color:white !important; min-height:500px; -} \ No newline at end of file +} + +.rowSelected td{ + background-color:#e8f8fe !important; +} + +#overlaytabArea{ + margin-top: 50px; + text-align: center; +} diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/index.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/index.html index 15cf0359..c9f19319 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/index.html +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/index.html @@ -44,7 +44,7 @@ - +
diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js index 04394a22..a792de8f 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js @@ -18,10 +18,12 @@ app.factory("DataService", function($http, $log){ var lcData = null; + var overLayData = null; var createParamJsonObj = { templateId:'', parameters: {} }; + var url = ""; var tableDataLoaded = false; return { @@ -38,9 +40,10 @@ app.factory("DataService", function($http, $log){ //load main Table return $http({ - url: '/openoapi/servicegateway/v1/services', + url: url+'/openoapi/servicegateway/v1/services', //url: 'http://localhost:5000/api/getLCData', method: 'GET', + data: null, headers: {'Content-Type': 'application/json'} /*url: '/openoapi/inventory/v1/services', @@ -73,9 +76,37 @@ app.factory("DataService", function($http, $log){ }, getOverlayData : function() { return $http({ - url: '/openoapi/sdnooverlayvpn/v1/site2dc-vpn', + url: url+'/openoapi/sdnooverlayvpn/v1/site2dc-vpn', //url: 'http://localhost:5000/api/getOverlayVPNData', method: 'GET', + data: null, + headers: {'Content-Type': 'application/json'} + }).then(function(response){ + //$log.info(response); + overLayData = response.data.overlayData; + return response.data; + }); + }, + getOverlayVPNConnData : function(id, type){ + var returnData = null; + if(overLayData) { + for (var i = 0; i < overLayData.length; i++) { + if(overLayData[i].id == id) { + returnData = overLayData[i][type]; + break; + } + } + return returnData; + } + else + return null; + }, + getSiteListData : function() { + return $http({ + url: url+'/openoapi/sdnobrs/v1/sites', + //url: 'http://localhost:5000/api/getOverlayVPNData', + method: 'GET', + data: null, headers: {'Content-Type': 'application/json'} }).then(function(response){ //$log.info(response); @@ -84,20 +115,37 @@ app.factory("DataService", function($http, $log){ }, getUnderlayData : function() { return $http({ - url: '/openoapi/sdnol3vpn/v1/l3vpns', + url: url+'/openoapi/sdnol3vpn/v1/l3vpns', //url: 'http://localhost:5000/api/getUnderlayVPNData', method: 'GET', + data: null, headers: {'Content-Type': 'application/json'} }).then(function(response){ //$log.info(response); + underlayData = response.data.data.underlayVPN; return response.data; }); }, + getTPLinkData : function(id){ + var returnData = null; + if(underlayData) { + for (var i = 0; i < underlayData.length; i++) { + if(underlayData[i].id == id) { + returnData = underlayData[i].tp_details; + break; + } + } + return returnData; + } + else + return null; + }, loadServiceTopoSequence : function(id) { return $http({ - url: '/openoapi/gso/v1/services/toposequence/' + id, + url: url+'/openoapi/gso/v1/services/toposequence/' + id, //url: 'http://localhost:5000/api/getOverlayVPNData', method: 'GET', + data: null, headers: {'Content-Type': 'application/json'} }).then(function(response){ //$log.info(response); @@ -118,9 +166,10 @@ app.factory("DataService", function($http, $log){ generateTemplatesComponent : function() { //dropdown data return $http({ - url: '/openoapi/catalog/v1/servicetemplates', + url: url+'/openoapi/catalog/v1/servicetemplates', //url: 'http://localhost:5000/api/getTemplateData', method: 'GET', + data: null, headers: {'Content-Type': 'application/json'} }).then(function(response){ //$log.info(response); diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js index e1dbdbed..a6fe604e 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js @@ -128,9 +128,35 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' }) .state("home.lcTabs.detailInfo.vpnManager.underlayVPN", { url: "/underlayVPN", - templateUrl : "templates/underlayVPN.html", + templateUrl : "templates/underlayVPN_L3.html", controller : "underlayVPNCtrl" }) + + .state("home.lcTabs.detailInfo.vpnManager.overlayVPN.overlayTabs", { + url: "/overlayTabs/:overlayId", + templateUrl : "templates/overlayTabs.html", + controller : "overlayTabsCtrl" + }) + .state("home.lcTabs.detailInfo.vpnManager.overlayVPN.overlayTabs.vpnConnections", { + url: "/vpnConnections", + templateUrl : "templates/vpnConnections.html", + controller : "vpnConnectionsCtrl" + }) + .state("home.lcTabs.detailInfo.vpnManager.overlayVPN.overlayTabs.vpnGateway", { + url: "/vpnGateway", + templateUrl : "templates/vpnGateway.html", + controller : "vpnGatewayCtrl" + }) + .state("home.lcTabs.detailInfo.vpnManager.overlayVPN.overlayTabs.siteList", { + url: "/siteList", + templateUrl : "templates/siteList.html", + controller : "siteListCtrl" + }) + .state("home.lcTabs.detailInfo.vpnManager.overlayVPN.overlayTabs.vpcList", { + url: "/vpcList", + templateUrl : "templates/vpcList.html", + controller : "vpcListCtrl" + }) /*modalStateProvider.state("home.lcTabs1", { url: '/lcTabs', templateUrl: 'templates/lctabs.html' @@ -149,10 +175,10 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' }); if(!DataService.getTableDataLoaded()) { DataService.loadGetServiceData() - .then(function (data) { - if (data) { - $scope.tableData = data.data; - var tableData = data.data; + .then(function (response) { + if (response.data) { + $scope.tableData = response.data; + var tableData = response.data; loadTableData(); //$timeout(loadTableData, 0); } @@ -645,7 +671,7 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' var deletehtml = Mustache.to_html(def_button_tpl, delete_data); $('div.overlayAction').html($compile(deletehtml)($scope));*/ - $scope.tableParams = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} + $scope.tableParams = new NgTableParams({count: 3, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} }, { counts:[], dataset: $scope.overlayData}); $scope.checkboxes = { 'checked': false, items: {} }; @@ -665,18 +691,25 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' $scope.checkboxes.items[user.id] }); }; + + $scope.rowHighilited=function(row) + { + $scope.selectedRow = row; + } + }) /*-------------------------------------------------------------------------------UnderlayVPN---------------------------------------------------------------------*/ .controller("underlayVPNCtrl", function($scope, $rootScope, $compile, DataService, NgTableParams){ $scope.message = "Underlay VPN"; + $scope.tpTableShowing = false; $scope.init = function() { //console.log("Underlay VPN... ng-init + " + $rootScope.lcmModelTemplate); DataService.getUnderlayData() - .then(function(data){ - $scope.underlayVPN = data.underlayVPN; + .then(function(response){ + $scope.underlayVPN = response.data.underlayVPN; console.log("Data: "); loadButtons(); }, function(reason){ @@ -692,7 +725,7 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' $('div.underlayAction').html($compile(deletehtml)($scope));*/ $scope.tableParams = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} - }, { counts:[5, 10], dataset: $scope.underlayVPN.underlayData}); + }, { counts:[5, 10], dataset: $scope.underlayVPN}); $scope.checkboxes = { 'checked': false, items: {} }; @@ -705,8 +738,8 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' }); }); - $scope.tableParams_tpDetails = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} - }, { counts:[5, 10], dataset: $scope.underlayVPN.tp_details}); + /*$scope.tableParams_tpDetails = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} + }, { counts:[5, 10], dataset: $scope.underlayVPN.tp_details});*/ } $scope.checkAll = function() { console.log("Checked .."); @@ -714,6 +747,21 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' $scope.checkboxes.items[data.id] }); }; + + $scope.loadTPLinkData = function(id, row){ + $scope.selectedRow = row; + $scope.tpTableShowing = true; + console.log("Underlay table row click"); + var tp_detData = DataService.getTPLinkData(id); + $scope.tableParams_tpDetails = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} + }, { counts:[5, 10], dataset: tp_detData}); + } + + $scope.rowHighilited=function(row) + { + $scope.selectedRow = row; + } + }) .controller('inputDataCtrl', function($scope, $stateParams, $log, DataService) { @@ -767,6 +815,46 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' }) + .controller('overlayTabsCtrl', function($scope, $state) { + $state.go('home.lcTabs.detailInfo.vpnManager.overlayVPN.overlayTabs.vpnConnections'); + }) + + .controller('vpnConnectionsCtrl', function($scope, $stateParams, NgTableParams, DataService) { + $scope.message = "VPN Connections"; + var rowData = DataService.getOverlayVPNConnData($stateParams.overlayId, "vpnConnections"); + $scope.vpnConnTable = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} + }, { counts:[5, 10], dataset: rowData}); + }) + + .controller('vpnGatewayCtrl', function($scope, $stateParams, NgTableParams, DataService) { + $scope.message = "VPN Gateway"; + var rowData = DataService.getOverlayVPNConnData($stateParams.overlayId, "vpnGateways"); + $scope.vpnGateTable = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} + }, { counts:[5, 10], dataset: rowData}); + }) + + .controller('siteListCtrl', function($scope, $stateParams, NgTableParams, DataService) { + $scope.message = "Site List"; + //var rowData = DataService.getSiteListData(); + DataService.getSiteListData() + .then(function (response) { + $scope.siteListData = response.sites; + $scope.siteTable = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} + }, { counts:[5, 10], dataset: $scope.siteListData}); + }, function (reason) { + $scope.message = "Error is :" + JSON.stringify(reason); + }); + }) + + .controller('vpcListCtrl', function($scope, $stateParams, NgTableParams, DataService) { + $scope.message = "VPN List"; + var rowData = DataService.getOverlayVPNConnData($stateParams.overlayId, "vpcList"); + $scope.vpcListTable = new NgTableParams({count: 5, sorting: {id: 'asc'} //{page: 1,count: 10,filter: {name: 'M'},sorting: {name: 'desc'} + }, { counts:[5, 10], dataset: rowData}); + }) + + + var lcmModelTemplate = ""; diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayTabs.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayTabs.html new file mode 100644 index 00000000..c2e04eb5 --- /dev/null +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayTabs.html @@ -0,0 +1,36 @@ + + + + + +
+ + + +
+ + + +
diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayVPN.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayVPN.html index 16719833..d7ca3ba4 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayVPN.html +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/overlayVPN.html @@ -18,46 +18,44 @@
{{message}}

- +

- - +
+ + - - - - - -
+ {{overlayData.id}} + {{overlayData.name}} - {{overlayData.desc}} - - {{overlayData.thinCPE}} - - {{overlayData.portVlan}} - - {{overlayData.dcName}} + {{overlayData.description}} - {{overlayData.vpc}} + + {{overlayData.actionState}} - {{overlayData.vpcCIDR}} + + {{overlayData.vpnDescriptor}} - + + +
+ +
diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L2.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L2.html new file mode 100644 index 00000000..4b8eedb5 --- /dev/null +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L2.html @@ -0,0 +1,78 @@ + + +
{{message}}
+
+ +
+ + +
+
+
+ + + + + + + + +
+ {{underlayData.name}} + + {{underlayData.thinCPE}} + + {{underlayData.desc}} + + + +
+
+ + + +
+
+
TP Details
+
+ + + + + + + + +
+ {{tpDetailsData.tp_name}} + + {{tpDetailsData.pe_name}} + + {{tpDetailsData.vlanId}} + + {{tpDetailsData.site_cidr}} + + {{tpDetailsData.ip}} +
+
+
\ No newline at end of file diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L3.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L3.html new file mode 100644 index 00000000..b91ec328 --- /dev/null +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/underlayVPN_L3.html @@ -0,0 +1,78 @@ + + +
{{message}}
+
+ +
+ + +
+
+
+ + + + + + + + +
+ {{underlayData.name}} + + {{underlayData.thinCPE}} + + {{underlayData.desc}} + + + +
+
+ + + +
+
+
TP Details
+
+ + + + + + + + +
+ {{tpDetailsData.tp_name}} + + {{tpDetailsData.pe_name}} + + {{tpDetailsData.vlanId}} + + {{tpDetailsData.site_cidr}} + + {{tpDetailsData.ip}} +
+
+
\ No newline at end of file diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpcList.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpcList.html new file mode 100644 index 00000000..1412a4c8 --- /dev/null +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpcList.html @@ -0,0 +1,45 @@ + + +
{{message}}
+
+
+
+ + + + + + + + +
+ {{vpcListData.id}} + + {{vpcListData.name}} +
+
+ + diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnConnections.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnConnections.html new file mode 100644 index 00000000..f57c0735 --- /dev/null +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnConnections.html @@ -0,0 +1,60 @@ + + +
{{message}}
+
+
+
+ + + + + + + + + + + + + +
+ {{vpnConnData.id}} + + {{vpnConnData.name}} + + {{vpnConnData.description}} + + {{vpnConnData.deployStatus}} + + {{vpnConnData.actionState}} + + {{vpnConnData.runningStatus}} + + {{vpnConnData.routeType}} +
+
+ + diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnGateway.html b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnGateway.html new file mode 100644 index 00000000..44d4c8d3 --- /dev/null +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/templates/vpnGateway.html @@ -0,0 +1,58 @@ + + +
{{message}}
+
+
+
+ + + + + + + + + + + + + + + +
+ {{vpnGateData.id}} + + {{vpnGateData.name}} + + {{vpnGateData.description}} + + {{vpnGateData.actionState}} + + {{vpnGateData.vpcId}} +
+
+ + -- 2.16.6