From 14a7bcff7da853ac073373b1efa0825e7cb366b7 Mon Sep 17 00:00:00 2001 From: Seshu-Kumar-M Date: Tue, 1 Nov 2016 11:23:33 +0800 Subject: create NE is not updating the controller info in the DB and is so blocking the further requests of the ESR. SDNO-828 Change-Id: I9b055518f8714e9c97a75b5be93806f4c5a57a6f Signed-off-by: Seshu-Kumar-M --- .../src/main/webapp/resmgr-sdn/js/brs.js | 30 ++++++++++++++++------ 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js b/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js index 27a70d02..9a92fdc2 100644 --- a/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js +++ b/openo-portal/portal-resmgr/src/main/webapp/resmgr-sdn/js/brs.js @@ -25,10 +25,7 @@ $('.siteDeleteImg').click(function () { }); -function hideFirstCol() { - //$('table tr').find('th:eq(0)').hide(); - //$('table tr').find('td:eq(0)').hide(); -} + function deleteSite(objectId) { var requestUrl = "/openoapi/sdnobrs/v1/sites/" + objectId; $ @@ -150,12 +147,18 @@ function loadNeData() { url: requestUrl, contentType: "application/json", success: function (jsonobj) { + var nedata = jsonobj.managedElements; + var neMap = []; + neMap = loadControllerData(); + /*$.each(nedata,function(k,v){ + nedata[k]; + })*/; + $('#ne').bootstrapTable({ data: nedata }); $('#ne').bootstrapTable('refresh'); - hideFirstCol(); }, error: function (xhr, ajaxOptions, thrownError) { @@ -181,18 +184,23 @@ function loadPortData() { }); } function loadControllerData() { + var neMap = []; var requestUrl = "/openoapi/extsys/v1/sdncontrollers"; $.ajax({ type: "GET", + async: false, url: requestUrl, contentType: "application/json", success: function (jsonobj) { - fillSelect(jsonobj); + + neMap = fillSelect(jsonobj); + }, error: function (xhr, ajaxOptions, thrownError) { alert("Error on getting controller data : " + xhr.responseText); } }); + return neMap; } function fillSelect(str){ var json; @@ -204,9 +212,12 @@ function fillSelect(str){ } var seleObj = $('#controller') seleObj.find("option").remove(); + var neMap = []; for(var i=0;i < json.length;i++){ - seleObj.append(''); + seleObj.append(''); + neMap[json[i].sdnControllerId] = json[i].name; } + return neMap; } $(function () { $('.creat-btn').click(function () { @@ -300,6 +311,9 @@ $(function () { $('#createNe').click(function () { var formData = JSON.stringify($("#neForm").serializeObject()); var jsonobj = JSON.parse(formData); + var controllerIDs = [] ; + controllerIDs[0]= jsonobj.controller; + jsonobj.controllerID = controllerIDs; var newJson = {"managedElement": jsonobj}; formData = JSON.stringify(newJson); var requestUrl = "/openoapi/sdnobrs/v1/managed-elements"; @@ -338,7 +352,7 @@ $(function () { data: formData, success: function (jsonResp) { alert("Port saved successfully!!!"); - //TODO : hide model data window. + jsonobj["id"] = jsonResp.logicalTerminationPoint.id; $('#port').bootstrapTable("append", jsonobj); $('#vmAppDialog').removeClass('in').css('display', 'none'); -- cgit 1.2.3-korg