From 140ae02914dbe36648c0d4e4c85b670f558b66b5 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Thu, 3 Nov 2016 11:47:02 +0800 Subject: fix issue:GSO-99 Change-Id: I3ee94b91b136a3f8c3733661d3dc8558f364d5d7 Signed-off-by: c00149107 --- .../src/main/webapp/lifecyclemgr/UnderLay_TP.html | 20 +++++++-- .../src/main/webapp/lifecyclemgr/accorTables.html | 47 +++++++++++++++++----- .../src/main/webapp/lifecyclemgr/gsolcmmain.html | 6 ++- .../src/main/webapp/lifecyclemgr/js/gsolcm.js | 20 +++++++-- .../webapp/lifecyclemgr/js/tmNodesController.js | 6 +-- .../src/main/webapp/lifecyclemgr/js/underlay.js | 24 ++++++----- .../src/main/webapp/lifecyclemgr/js/vpn.js | 16 ++++---- .../src/main/webapp/lifecyclemgr/overlayvpn.html | 26 +++++++++--- .../src/main/webapp/lifecyclemgr/underlayvpn.html | 24 ++++++----- 9 files changed, 135 insertions(+), 54 deletions(-) (limited to 'openo-portal/portal-lifecyclemgr/src/main/webapp') diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/UnderLay_TP.html b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/UnderLay_TP.html index 17c24427..1c8effdd 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/UnderLay_TP.html +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/UnderLay_TP.html @@ -60,10 +60,24 @@ + + @@ -64,7 +66,9 @@ $("#inpContMod").hide(); $('#sai').bootstrapTable({}) .on('click-row.bs.table', function (e, row, $element) { - var newURL = "accorTables.html?serviceId="+row.serviceId; + + var newURL = "accorTables.html?serviceId="+row.serviceId + "&serviceType="+row.serviceType; + // var newURL = "accorTables.html?serviceId="+row.serviceId ; console.log("URL: "+newURL); document.getElementById("tabContainer").style.display = "none"; document.getElementById("detailConObj").setAttribute('data', newURL); diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js index 723ea7dc..d5549ebb 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/gsolcm.js @@ -21,6 +21,12 @@ var templateParameters = { var lcmHandler = function () { this._addOwnEvents(); + jQuery.i18n.properties({ + language:'en-US', + name:'lcm-template-parameters-i18n', + path:'i18n/', + mode:'map' + }); }; lcmHandler.prototype = { @@ -454,15 +460,23 @@ function transformToOptions(items) { function generateComponent(inputPara) { var component = '
' + '' + '
' + '' + + showName(inputPara) + '" value="' + inputPara.value + '" />' + '
'; return component; } +function showName(inputPara) { + var name = $.i18n.prop(inputPara.name) + if(name.length === 0 || name.slice(0, 1) === '[') { + name = inputPara.showName; + } + return name; +} + function generateRequiredLabel(parameter) { var requiredLabel = ''; if (parameter.required === 'true') { @@ -701,7 +715,7 @@ function deleteNe(rowId, row) { } else if (serviceType === 'NFVO') { var nfvoLcmUri = '/openoapi/nslcm/v1'; deleteNonGsoServiceInstance(gatewayService, nfvoLcmUri, instanceId, remove, failFun); - } else if (serviceType === 'SDNO') { + } else if (serviceType === 'SDNO' || serviceType === 'SSAR') { var sdnoLcmUri = '/openoapi/sdnonslcm/v1'; deleteNonGsoServiceInstance(gatewayService, sdnoLcmUri, instanceId, remove, failFun); } diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/tmNodesController.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/tmNodesController.js index 6f1235a6..1510d129 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/tmNodesController.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/tmNodesController.js @@ -35,7 +35,7 @@ var vm = avalon.define({ } }, $restUrl: { - queryNodeInstanceUrl: "/openoapi/nslcm/v1.0/ns/" + queryNodeInstanceUrl: "/openoapi/nslcm/v1/ns/" }, $init: function () { vm.$initInstanceData(); @@ -147,7 +147,7 @@ var vm = avalon.define({ ], "aaData": tableData }); - }; + }, //nodes list table nodesList :{ @@ -186,7 +186,7 @@ var initParam = function () { var instanceId = params[0].substring(params[0].indexOf('=') + 1); vm.instanceId = instanceId; - vm.$restUrl.queryNodeInstanceUrl = commonUtil.format(vm.$restUrl.queryNodeInstanceUrl, instanceId); + vm.$restUrl.queryNodeInstanceUrl = vm.$restUrl.queryNodeInstanceUrl + instanceId; vm.$init(); } }; diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js index 6a2a8bf1..e52d0150 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/underlay.js @@ -20,24 +20,26 @@ $.getJSON("./conf/dataconfig.json", function (jsonData){ console.log("URL = " + JSON.stringify(url)); }); -function loadUnderlayData() { - var requestUrl = url.underlay + "/openoapi/sdnol3vpn/v1/l3vpns"; +function loadUnderlayData(serviceId) { + var requestUrl = "/openoapi/sdnol3vpn/v1/l3vpns/" + serviceId; + var returnObj; $ .ajax({ type: "GET", url: requestUrl, + async: false, contentType: "application/json", success: function (jsonobj) { - alert("loading underlay data"); - //TODO: Update the table + returnObj = jsonobj; }, error: function (xhr, ajaxOptions, thrownError) { //alert("Error on getting underlay data : " + xhr.responseText); } }); + return returnObj; } function deleteUnderlayData(objectId) { - var requestUrl = url.underlay + "/openoapi/sdnol3vpn/v1/l3vpns/" + objectId; + var requestUrl = "/openoapi/sdnol3vpn/v1/l3vpns/" + objectId; $ .ajax({ type: "DELETE", @@ -52,21 +54,23 @@ function deleteUnderlayData(objectId) { } }); } -function loadOverlayData() { - var requestUrl = url.overlay + "/openoapi/sdnooverlayvpn/v1/site2dc-vpn"; +function loadOverlayData(serviceId) { + var requestUrl = "/openoapi/sdnooverlay/v1/site2dc-vpn/" + serviceId; + var returnObj; $ .ajax({ type: "GET", url: requestUrl, + async: false, contentType: "application/json", success: function (jsonobj) { - alert("loading Overlay data..."); - //TODO: Update the table + returnObj = jsonobj; }, error: function (xhr, ajaxOptions, thrownError) { //alert("Error on getting Overlayvpn data : " + xhr.responseText); } }); + return returnObj; } function refressTpDataTable(overlayTable, TpTable) { alert("refesssing Tp data table"); @@ -91,7 +95,7 @@ $(function () { var formData = JSON.stringify($("#underlayForm").serializeObject()); alert(formData); var jsonobj = JSON.parse(formData); - var requestUrl = url.underlay + "/openoapi/sdnol3vpn/v1/l3vpns"; + var requestUrl = "/openoapi/sdnol3vpn/v1/l3vpns"; $ .ajax({ type: "POST", diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js index 71ffdf3e..a1656b9f 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/js/vpn.js @@ -21,7 +21,7 @@ $.getJSON("./conf/dataconfig.json", function (jsonData){ function deleteSite(objectId) { alert(objectId); - var requestUrl = url + "/openoapi/sdnobrs/v1/sites" + objectId; + var requestUrl = "/openoapi/sdnobrs/v1/sites" + objectId; $ .ajax({ type: "DELETE", @@ -37,7 +37,7 @@ function deleteSite(objectId) { }); } function deleteLink(objectId) { - var requestUrl = url + "/openoapi/sdnobrs/v1/topological-links" + objectId; + var requestUrl = "/openoapi/sdnobrs/v1/topological-links" + objectId; $ .ajax({ type: "DELETE", @@ -54,7 +54,7 @@ function deleteLink(objectId) { } function deleteNe(objectId) { - var requestUrl = url + "/sdnobrs/v1/managed-elements" + objectId; + var requestUrl = "/sdnobrs/v1/managed-elements" + objectId; $ .ajax({ type: "DELETE", @@ -71,7 +71,7 @@ function deleteNe(objectId) { } function deletePort(objectId) { - var requestUrl = url + "/openoapi/sdnobrs/v1/logical-termination-points" + objectId; + var requestUrl = "/openoapi/sdnobrs/v1/logical-termination-points" + objectId; $ .ajax({ type: "DELETE", @@ -87,7 +87,7 @@ function deletePort(objectId) { }); } function loadSiteData() { - var requestUrl = url + "/openoapi/sdnobrs/v1/sites"; + var requestUrl = "/openoapi/sdnobrs/v1/sites"; $ .ajax({ type: "GET", @@ -103,7 +103,7 @@ function loadSiteData() { }); } function loadLinkData() { - var requestUrl = url + "/openoapi/sdnobrs/v1/topological-links"; + var requestUrl = "/openoapi/sdnobrs/v1/topological-links"; $ .ajax({ type: "GET", @@ -119,7 +119,7 @@ function loadLinkData() { }); } function loadNeData() { - var requestUrl = url + "/sdnobrs/v1/managed-elements"; + var requestUrl = "/sdnobrs/v1/managed-elements"; $ .ajax({ type: "GET", @@ -135,7 +135,7 @@ function loadNeData() { }); } function loadPortData() { - var requestUrl = url + "/openoapi/sdnobrs/v1/logical-termination-points"; + var requestUrl = "/openoapi/sdnobrs/v1/logical-termination-points"; $ .ajax({ type: "GET", diff --git a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/overlayvpn.html b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/overlayvpn.html index 7656f57b..2604de80 100644 --- a/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/overlayvpn.html +++ b/openo-portal/portal-lifecyclemgr/src/main/webapp/lifecyclemgr/overlayvpn.html @@ -36,11 +36,25 @@