summaryrefslogtreecommitdiffstats
path: root/openo-portal
diff options
context:
space:
mode:
authorc00149107 <chenchuanyu@huawei.com>2016-10-31 17:13:05 +0800
committerc00149107 <chenchuanyu@huawei.com>2016-10-31 17:13:05 +0800
commite7adec9a6b3e52513d5326c6c36d03440533a233 (patch)
tree0b9036852d492086c1c367b8cb0f349dfcd34b62 /openo-portal
parent27b249b8249f30acb2085d98462253035983fe5c (diff)
fix issue:GSO-89
Change-Id: I67c5e24d6bbd82f7e1340c9e93d19b9cc1e929b9 Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'openo-portal')
-rw-r--r--openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/InputData.html17
-rw-r--r--openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/rest.js48
2 files changed, 63 insertions, 2 deletions
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 d76182ce..b5a2d98c 100644
--- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/InputData.html
+++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/InputData.html
@@ -43,9 +43,22 @@
var name = key;
if(name.includes('.'))
{
- name = key.substring(key.lastInexOf('.')+1,key.length);
+ name = key.substring(key.lastIndexOf('.')+1,key.length);
}
- $("body").append('<div class="mT15 form-group row" style="margin-top:35px;margin-left:25%"><div class="col-sm-6" align="right"><label class="control-label"><span style="font-size:16px;">'+ name + ':</span></label></div><div class="col-sm-6"><input type="text" name="" maxlength="256" style="margin-left:10px;width:250px;" data-toggle="tooltip" data-placement="top" title="'+ jsonData.inputParameters[key] + '" value="'+ jsonData.inputParameters[key] + '" readonly disabled/></div></div>');
+ 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('<div class="mT15 form-group row" style="margin-top:35px;margin-left:25%"><div class="col-sm-6" align="right"><label class="control-label"><span style="font-size:16px;">'+ name + ':</span></label></div><div class="col-sm-6"><input type="text" name="" maxlength="256" style="margin-left:10px;width:250px;" data-toggle="tooltip" data-placement="top" title="'+ paramValue + '" value="'+ paramValue + '" readonly disabled/></div></div>');
}
}
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