summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Shen <shentao@chinamobile.com>2017-04-21 11:10:39 +0000
committerGerrit Code Review <gerrit@open-o.org>2017-04-21 11:10:39 +0000
commit09f199f779f936e40e520ec7d2b46654dfcbdc92 (patch)
tree97ca9b8922c6274d6450e7ec21c7a14083f02acf
parent2a6edc2926f45f73004dc1fe799cfac0539ca0d6 (diff)
parent9071527d13dfa6ab7e7b81a3a11c3c41c3d9aec9 (diff)
Merge "Check ServiceType for details"
-rw-r--r--lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js21
-rw-r--r--lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js25
2 files changed, 32 insertions, 14 deletions
diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js
index 65189e4e..04394a22 100644
--- a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js
+++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js
@@ -62,7 +62,7 @@ app.factory("DataService", function($http, $log){
if(lcData) {
for (var i = 0; i < lcData.length; i++) {
if(lcData[i].serviceId == id) {
- returnData = lcData[i].inputParameters;
+ returnData = lcData[i];
break;
}
}
@@ -93,8 +93,23 @@ app.factory("DataService", function($http, $log){
return response.data;
});
},
- loadServiceDetails : function(id) {
- return JSON.parse('[{"id":"12345", "name":"sdno"}, {"id":"23456", "name":"gso"},{"id":"12345", "name":"nfvo"}]');
+ loadServiceTopoSequence : function(id) {
+ return $http({
+ url: '/openoapi/gso/v1/services/toposequence/' + id,
+ //url: 'http://localhost:5000/api/getOverlayVPNData',
+ method: 'GET',
+ headers: {'Content-Type': 'application/json'}
+ }).then(function(response){
+ //$log.info(response);
+ var serviceToposequence = response.data;
+ var responseData = [];
+ for (var i = 0; i < serviceToposequence.service.segments.length; i++) {
+ var segment = serviceToposequence.service.segments[i];
+ responseData[i] = {"id":segment.serviceSegmentId, "name":segment.serviceSegmentType};
+ }
+ return responseData;
+ });
+ //return JSON.parse('[{"id":"12345", "name":"sdno"}, {"id":"23456", "name":"gso"},{"id":"12345", "name":"nfvo"}]');
},
loadNfvoServiceDetails : function(id) {
return JSON.parse('{"vnfInfoId": [{ "vnfInstanceId": "123", "vnfInstanceName": "vnf instance 1", "vnfProfileId": "321" }, { "vnfInstanceId": "123", "vnfInstanceName": "vnf instance 1", "vnfProfileId": "321" }], "vlInfo": [{ "networkResource": {"resourceName": "network resource 1"}, "linkPortResource": { "resourceName": "link port resource 1"}}, { "networkResource": {"resourceName": "network resource 1"}, "linkPortResource": { "resourceName": "link port resource 1"}}], "vnffgInfo": [{"vnfId": "vnfid-123", "virtualLinkId": "virtual link 123", "cpId": "cp id 123", "nfp": "nfp 123"}, {"vnfId": "vnfid-123", "virtualLinkId": "virtual link 123", "cpId": "cp id 123", "nfp": "nfp 123"}]}');
diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js
index 053ee41d..e1dbdbed 100644
--- a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js
+++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js
@@ -536,23 +536,25 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', '
console.log("detailInfoCtrl --> $stateParams.id:: " + $stateParams.id);
//$scope.currentId = $stateParams.id;
$scope.rightPanelHeader = "VPN Manager";
-
- var jsonData = DataService.loadServiceDetails($stateParams.id);
+ var rowData = DataService.getSavedLCData($stateParams.id);
+ var jsonData =[];
+ if(rowData.serviceType === "SDNO" || rowData.serviceType === "NFVO"){
+ jsonData[0] = {"id": $stateParams.id, "name": rowData.serviceType};
+ }
+ else{
+ jsonData = DataService.loadServiceTopoSequence($stateParams.id);
+ }
$(".accordion").html("");
for (var i = 0; i < jsonData.length; i++) {
//console.log("jsonData Name: " + jsonData[i].name);
- if (jsonData[i].name == "sdno") {
+ if (jsonData[i].name == "SDNO") {
//$("#sdnoLink").text(jsonData[i].name.toUpperCase());
//console.log("Adding Accordian to SDNO");
- $(".accordion").append($compile(addAccordionData("sdno", jsonData[i].name.toUpperCase(), $stateParams.id))($scope));
- }
- else if (jsonData[i].name == "gso") {
- //console.log("Adding Accordian to GSO");
- $(".accordion").append($compile(addAccordionData("gso", jsonData[i].name.toUpperCase(), $stateParams.id))($scope));
+ $(".accordion").append($compile(addAccordionData("sdno", jsonData[i].name.toUpperCase(), jsonData[i].id))($scope));
}
- else if (jsonData[i].name == "nfvo") {
+ else if (jsonData[i].name == "NFVO") {
//console.log("Adding Accordian to NFVO");
- $(".accordion").append($compile(addAccordionData("nfvo", jsonData[i].name.toUpperCase(), $stateParams.id))($scope));
+ $(".accordion").append($compile(addAccordionData("nfvo", jsonData[i].name.toUpperCase(), jsonData[i].id))($scope));
}
else {
@@ -716,7 +718,8 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', '
.controller('inputDataCtrl', function($scope, $stateParams, $log, DataService) {
console.log("inputDataCtrl --> $stateParams.id:: " + $stateParams.id);
- $scope.inputData = DataService.getSavedLCData($stateParams.id);
+ var rowData = DataService.getSavedLCData($stateParams.id);
+ $scope.inputData = rowData.inputParameters;
$log.info($scope.inputData);
$("div.inputDataElements").html("");
$("div.inputDataElements").append(convertInputsToUI('', 'show', $scope.inputData));