From 865fbe14f6d128bccb2c79f5d33e4119116604cd Mon Sep 17 00:00:00 2001 From: c00149107 Date: Mon, 31 Oct 2016 17:19:04 +0800 Subject: fix issue:GSO-89 Change-Id: I8fd10bc09cbab78c3babbd82b8ed81bd61aa4c79 Signed-off-by: c00149107 --- .../src/main/webapp/lifecyclemgr/InputData.html | 25 ++++++++--- .../src/main/webapp/lifecyclemgr/js/rest.js | 48 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) (limited to 'openo-portal/portal-lifecyclemgr/src') diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/InputData.html b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/InputData.html index e11bd632..b5a2d98c 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/InputData.html +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/InputData.html @@ -40,12 +40,25 @@ if (jsonData != null) { $("body").empty(); for(var key in jsonData.inputParameters){ - var name = key; - if(name.includes('.')) - { - name = key.substring(key.lastInexOf('.')+1,key.length); - } - $("body").append('
'); + var name = key; + if(name.includes('.')) + { + name = key.substring(key.lastIndexOf('.')+1,key.length); + } + var paramValue = jsonData.inputParameters[key]; + if(name.indexOf('location') != -1) { + var vimObj = getVimNameById(paramValue); + if(vimObj != undefined){ + paramValue = vimObj.name; + } + } + else if(name.indexOf('sdncontroller') != -1){ + var sdnControllerObj = getSdnControllerNameById(paramValue); + if(sdnControllerObj != undefined){ + paramValue = sdnControllerObj.name; + } + } + $("body").append('
'); } } diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js index a6e2eba3..ddeabf7e 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js @@ -220,6 +220,54 @@ function loadServiceDetails(serviceId){ return returnObj; } +//get the vim name by id. +function getVimNameById(vimId){ + + // TODO re-confirm the latest url. + var requestUrl ="/openoapi/extsys/v1/vims/" + vimId; + var returnObj; + $ + .ajax({ + type : "GET", + async: false, + url : requestUrl, + contentType : "application/json", + success : function(jsonobj) { + // TODO return according to the json data received. + returnObj = jsonobj; + }, + error : function(xhr, ajaxOptions, thrownError) { + alert("Error on getting link data : " + xhr.responseText); + } + }); + return returnObj; +} + +// get the sdn controller name by id. +function getSdnControllerNameById(sdnControllerId){ + + // TODO re-confirm the latest url. + var requestUrl ="/openoapi/extsys/v1/sdncontrollers/" + sdnControllerId; + var returnObj; + $ + .ajax({ + type : "GET", + async: false, + url : requestUrl, + contentType : "application/json", + success : function(jsonobj) { + // TODO return according to the json data received. + returnObj = jsonobj; + }, + error : function(xhr, ajaxOptions, thrownError) { + alert("Error on getting link data : " + xhr.responseText); + } + }); + return returnObj; +} + + + function anchorClick(serviceId){ var jsonData = loadServiceDetails(serviceId); //TODO populate the modal according to json response -- cgit 1.2.3-korg