From 993330a8817ffbd94a4f4bbd38d20e26b2e77350 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Mon, 24 Apr 2017 17:47:59 +0800 Subject: Fix resmgr client showing errors Fix resmgr client showing errors Change-Id: I493d7089c262ee0bf8078259fe2e287d2966731f Issue-ID:CLIENT-200 Signed-off-by: c00149107 --- resmgr/src/main/webapp/resmgr/js/app.js | 25 +++++++++++++++------- .../main/webapp/resmgr/sdn-resmgr/port/port.html | 1 + .../main/webapp/resmgr/sdn-resmgr/port/portRest.js | 8 +++++++ 3 files changed, 26 insertions(+), 8 deletions(-) (limited to 'resmgr/src/main/webapp') diff --git a/resmgr/src/main/webapp/resmgr/js/app.js b/resmgr/src/main/webapp/resmgr/js/app.js index 2ffcc2b6..2ca5177b 100644 --- a/resmgr/src/main/webapp/resmgr/js/app.js +++ b/resmgr/src/main/webapp/resmgr/js/app.js @@ -134,9 +134,18 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) var portName = {"ErrMsg" : {"errmsg" : "Name is required.", "modalVar":"port.name", "errtag":"textboxErrName", "errfunc":"validatetextboxName", "required":true}}; $('#myModal #name').append($compile(Mustache.to_html(text, portName.ErrMsg))($scope)); - var portMe = {"ErrMsg" : {"errmsg" : "ME is required.", "modalVar":"port.meID", "errtag":"textboxErrMe", "errfunc":"validatetextboxMe", "required":true}}; - $('#myModal #meID').append($compile(Mustache.to_html(text, portMe.ErrMsg))($scope)); - + portDataService.getAllNEData().then(function(response) { + var medata = []; + for(var i = 0; i < response.managedElements.length; i+=1){ + medata[i] = {"serviceTemplateId":response.managedElements[i].id,"templateName":response.managedElements[i].name}; + } + var dropdownInfo = translateToDropdownInfo(medata); + $("#myModal #medropdown").html(dropdownInfo); + console.log("Data: "); + $log.info(data); + }, function(reason) { + $scope.message = "Error is :" + JSON.stringify(reason); + }); //var portType = {"ErrMsg" : {"textboxErr" : "The name is required.", "modalVar":"port.type"}}; //$('#myModal #type').append($compile(Mustache.to_html(dropDown, $scope.data.dropdowntypeData))($scope)); @@ -148,7 +157,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/ - var dropdownResponse=[{"serviceTemplateId":"tenant_site","templateName":"portType1"},{"serviceTemplateId":"tenant_site2","templateName":"portType2"}]; + var dropdownResponse=[{"serviceTemplateId":"ETH","templateName":"ETH"},{"serviceTemplateId":"POS","templateName":"POS"},{"serviceTemplateId":"Trunk","templateName":"Trunk"},{"serviceTemplateId":"Loopback","templateName":"Loopback"}]; var dropdownInfo = translateToDropdownInfo(dropdownResponse); document.getElementById("portdropdown").innerHTML = dropdownInfo; @@ -169,7 +178,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#myModal #Edgepoint').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/ - var dropdownResponse=[{"serviceTemplateId":"tenant_site","templateName":"Edgepoint1"},{"serviceTemplateId":"tenant_site2","templateName":"Edgepoint2"}]; + var dropdownResponse=[{"serviceTemplateId":"true","templateName":"true"},{"serviceTemplateId":"false","templateName":"false"}]; var dropdownInfo = translateToDropdownInfo(dropdownResponse); document.getElementById("portEdropdown").innerHTML = dropdownInfo; @@ -464,7 +473,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) $('#myModal #type').append($compile(Mustache.to_html(dropDown, dropSimple_data))($scope));*/ - var dropdownResponse=[{"serviceTemplateId":"tenant_site","templateName":"tenant_site"},{"serviceTemplateId":"tenant_site2","templateName":"tenant_site2"}]; + var dropdownResponse=[{"serviceTemplateId":"network_site","templateName":"network_site"},{"serviceTemplateId":"tenant_site","templateName":"tenant_site"}]; var dropdownInfo = translateToDropdownInfo(dropdownResponse); document.getElementById("sitedropdown").innerHTML = dropdownInfo; @@ -1212,7 +1221,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) neDataService.getNECtrlDDList() .then(function (response) { - $scope.ctrlList = response.data; + $scope.ctrlList = response; var dropdownInfo = translateCtrlIDToDropdownInfo($scope.ctrlList); $("#myModal #medropdown").html(dropdownInfo); console.log("Data: "); @@ -1224,7 +1233,7 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) /*var neController = {"ErrMsg" : {"errmsg" : "IP Address is required.", "modalVar":"ne.controller"}}; $('#myModal #controller').append($compile(Mustache.to_html(text, neController.ErrMsg))($scope));*/ - var neIPAddress = {"ErrMsg" : {"errmsg" : "IP Address is required.", "modalVar":"ne.ipAddress","errtag":"textboxErrIP", "errfunc":"validatetextboxIP","required":true}}; + var neIPAddress = {"ErrMsg" : {"errmsg" : "IP Address is required.", "modalVar":"ne.ipAddress"}}; $('#myModal #ipAddress').append($compile(Mustache.to_html(text, neIPAddress.ErrMsg))($scope)); diff --git a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html index f81265b0..e980af6a 100644 --- a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html +++ b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/port.html @@ -95,6 +95,7 @@
+
diff --git a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js index 6bed2640..ad960cd7 100644 --- a/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js +++ b/resmgr/src/main/webapp/resmgr/sdn-resmgr/port/portRest.js @@ -90,6 +90,14 @@ app.factory("portDataService", function($http,DataService, $log){ console.log(response); return response; }); + }, + getAllNEData : function() { + return DataService.get("/openoapi/extsys/v1/sdncontrollers") + .then(function(response){ + $log.info("in get data service data is :"+response); + console.log(response); + return response; + }); } } }); \ No newline at end of file -- cgit 1.2.3-korg