diff options
author | Luji7 <lu.ji3@zte.com.cn> | 2017-04-27 16:53:56 +0800 |
---|---|---|
committer | Luji7 <lu.ji3@zte.com.cn> | 2017-04-27 16:54:04 +0800 |
commit | f93585aca6ecaf807316971369d7f4b4536471ea (patch) | |
tree | d38357469ccc82c6d513e9778e3b874a5a4dd31e /lifecyclemgr | |
parent | 3fb2b8ef707b9a9407baf9b4fc4fe26537575f1d (diff) |
NFVO Detail information display wrong
Issue-id: CLIENT-205
Change-Id: Iab9dcf9f1cc8fabe0fda4bfb2287c06cd5f06491
Signed-off-by: Luji7 <lu.ji3@zte.com.cn>
Diffstat (limited to 'lifecyclemgr')
-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"];
|