diff options
-rw-r--r-- | lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js | 12 | ||||
-rw-r--r-- | lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js | 16 |
2 files changed, 19 insertions, 9 deletions
diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js index 34c991f8..0361864d 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/DataService.js @@ -195,8 +195,16 @@ app.factory("DataService", function($http, $log){ });
//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"}]}');
+ loadNfvoServiceDetails : function(id, processFun) {
+ return $http({
+ url: url+'/openoapi/nslcm/v1/ns/' + id,
+ method: 'GET',
+ data: null,
+ headers: {'Content-Type': 'application/json'}
+ }).then(function(response){
+ processFun(response.data);
+ });
+ // 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"}]}');
},
generateTemplatesComponent : function() {
diff --git a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js index 8803c623..1d6114f8 100644 --- a/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js +++ b/lifecyclemgr/src/main/webapp/lifecyclemgr/js/app.js @@ -793,16 +793,18 @@ var app = angular.module("lcApp", ["ui.router", "ngTable"])/*, 'ui.bootstrap', ' console.log("nfvoDetailCtrl --> $stateParams.id:: " + $stateParams.id);
//$scope.currentId = $stateParams.id;
- var jsonData = DataService.loadNfvoServiceDetails($stateParams.id);
var table_tpl = $(lcmModelTemplate).filter('#table').html();
- var vnfData = fetchDataForVnf(jsonData);
- $('#vnfInfoTable').html(Mustache.to_html(table_tpl, vnfData));
+ var processFun = function (jsonData) {
+ var vnfData = fetchDataForVnf(jsonData);
+ $('#vnfInfoTable').html(Mustache.to_html(table_tpl, vnfData));
- var vlData = fetchDataForVl(jsonData);
- $('#vlInfoTable').html(Mustache.to_html(table_tpl, vlData));
+ var vlData = fetchDataForVl(jsonData);
+ $('#vlInfoTable').html(Mustache.to_html(table_tpl, vlData));
- var vnffgData = fetchDataForVnffg(jsonData);
- $('#vnffgInfoTable').html(Mustache.to_html(table_tpl, vnffgData));
+ var vnffgData = fetchDataForVnffg(jsonData);
+ $('#vnffgInfoTable').html(Mustache.to_html(table_tpl, vnffgData));
+ };
+ DataService.loadNfvoServiceDetails($stateParams.id, processFun);
function fetchDataForVnf(jsonData) {
var header = ["Vnf instance Name"];
|