aboutsummaryrefslogtreecommitdiffstats
path: root/openo-portal/portal-catalog
diff options
context:
space:
mode:
authornancylizi <li.zi30@zte.com.cn>2016-10-31 14:45:20 +0800
committernancylizi <li.zi30@zte.com.cn>2016-10-31 14:45:20 +0800
commit334034c7ac2d382b5a91084a833a6d152db31436 (patch)
tree6ef2254b59316d44bc1584bf15fcf5e17dae825e /openo-portal/portal-catalog
parentc0a2ffc492d72633996afdb521a41aa8d86893cb (diff)
Fix the bug "Can not show package detail", remove the modeldsigner child menu.
Change-Id: I6d9231db6e0d8458c33a228861a441ea27707ba5 Issue-id:GSO-86 Signed-off-by: nancylizi <li.zi30@zte.com.cn>
Diffstat (limited to 'openo-portal/portal-catalog')
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmController.js15
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js15
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/js/template/topoUtil.js4
3 files changed, 19 insertions, 15 deletions
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmController.js b/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmController.js
index 3b19d23e..714d953c 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmController.js
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmController.js
@@ -83,6 +83,7 @@ var vm = avalon.define({
setting.language = vm.$language;
setting.paginate = true;
setting.info = true;
+ setting.sort = true;
setting.columns = vm.$packageTableFields.table;
setting.restUrl = vm.$restUrl.queryPackageInfoUrl;
setting.tableId = vm.$tableId;
@@ -120,15 +121,13 @@ var vm = avalon.define({
vm.packageDetail.detailData[index].isActive = true;
},
$initPackageDetailTable : function (csarId) {
- var data;
- for(var i=0; i<vm.resource.packageInfo.length; i++) {
- if (vm.resource.packageInfo[i].csarId == csarId) {
- data = vm.resource.packageInfo[i];
- break;
+ var url=vm.$restUrl.queryPackageInfoUrl + "/" + csarId;
+ commonUtil.get(url,null,function(resp) {
+ if (resp) {
+ vm.resource.packageDetails=resp;
}
- }
- vm.resource.packageDetails = data;
- vm.resource.relationInfo = [];
+ })
+
},
$isRowDeletingStatus : function(name) {
var table = $("#" + vm.$tableId).dataTable();
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js b/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js
index d69be0a0..80067abc 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js
@@ -110,8 +110,13 @@ pmUtil.doOnBoard = function(url,param) {
}
refreshByCond();
},
- error : function() {
- commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-onBoard-error"), "failed");
+ error : function(resp) {
+ if(resp != "" && resp.responseText == "success") {
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-onBoarded"), "success");
+ refreshByCond();
+ } else {
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-onBoard-error"), "failed");
+ }
}
});
}
@@ -132,7 +137,7 @@ pmUtil.doNFAROnboard = function(extData) {
}
refreshByCond();
},
- error : function() {
+ error : function(resp) {
commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-onBoard-error"), "failed");
}
});
@@ -151,7 +156,7 @@ pmUtil.doSSAROnboard = function(url) {
}
refreshByCond();
},
- error : function() {
+ error : function(resp) {
commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-onBoard-error"), "failed");
}
});
@@ -182,7 +187,7 @@ pmUtil.delPackage = function (url) {
pmUtil.nameRender = function(obj) {
return '<a href="#" onclick="vm.packageDetail.$showDetails('
- + '\'block\',\'' + obj.aData.id + '\', \'' + obj.aData.name + '\')">' + obj.aData.name + '</a>';
+ + '\'block\',\'' + obj.aData.csarId + '\', \'' + obj.aData.name + '\')">' + obj.aData.name + '</a>';
}
pmUtil.onBoardRender = function(obj) {
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/js/template/topoUtil.js b/openo-portal/portal-catalog/src/main/webapp/catalog/js/template/topoUtil.js
index 2c0561e0..47bd9a5d 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/js/template/topoUtil.js
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/js/template/topoUtil.js
@@ -388,7 +388,7 @@ topoUtil.generateNodeTemplate = function(data) {
nodeTemplate.currentLinkNum = 0;
var relationShips = data.relationShips || []; //some nodes may not have relationships
$.each(relationShips, function(index, obj){
- if (obj.sourceNodeId == data.id) {
+ if (obj.sourceNodeId == data.name) {
switch(obj.type) {
case "containedIn" :
case "tosca.relationships.nfv.ContainedIn" :
@@ -414,7 +414,7 @@ topoUtil.generateNodeTemplate = function(data) {
break;
}
}
- if (obj.targetNodeId == data.id) {
+ if (obj.targetNodeId == data.name) {
switch(obj.type) {
case "connectedTo" :
case "tosca.relationships.nfv.ConnectsTo" :