From e72810be1784a25ef87a91e86a468bac31ed7752 Mon Sep 17 00:00:00 2001 From: nancylizi Date: Thu, 13 Oct 2016 09:26:34 +0800 Subject: Fix the bug "A message showed in a wrong time when upload package." and modify the css of select vim dialog. Change-Id: If5b05fbef0eedf496e50c37245826af422885693 Issue-id:GSO-18 Signed-off-by: nancylizi --- .../portal-catalog/src/main/webapp/catalog/csarPackage.html | 6 +++++- .../portal-catalog/src/main/webapp/catalog/css/package.css | 9 +++++++++ .../main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties | 2 +- .../portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html b/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html index 827f13e7..c1611414 100644 --- a/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html +++ b/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html @@ -226,7 +226,11 @@ - + +
+ {{rest.name}} +
+
+ ms-click="vm.onBoardPackage(res.csarId,res.type,res.onBoardState)"> {{res.onBoardState}} @@ -117,6 +117,26 @@
+
+
+
+ + Found total + + records + +
+
+
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties index 3b2cf39a..5b34be2a 100644 --- a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties +++ b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties @@ -84,6 +84,7 @@ nfv-package-iui-message-upload-csar-exist=There is a package in the same name, t nfv-package-iui-message-upload-csar-deletionpending=This package is referenced in an instance. whether to re upload? nfv-package-iui-message-onBoarded = Already onBoarded, no need for onBoarding. nfv-package-iui-message-onBoard-error = Onboarding error. +nfv-package-iui-message-delete-error = Package delete error. nfv-package-iui-message-select-vim-error = Can not select more than one VIM to be test environment. nfv-package-iui-onboard-dialog-vimname = VIM Name nfv-package-iui-product-env = Product Environment @@ -147,3 +148,6 @@ nfv-topology-iui-message-error=Query Topology Information failed. nfv-software-iui-action-delete=Delete nfv-software-iui-action-onboard=Onboard + +com_zte_openo_umc_monitor_monitorList_total=total +com_zte_openo_umc_monitor_monitorList_records=records \ No newline at end of file diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties index 478289f9..616398b4 100644 --- a/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties +++ b/openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties @@ -85,6 +85,7 @@ nfv-package-iui-message-upload-csar-exist=包已经存在,是否重新上传 nfv-package-iui-message-upload-csar-deletionpending=实例中引用了此包,是否重新上传? nfv-package-iui-message-onBoarded = 已经上载,无需再次上载。 nfv-package-iui-message-onBoard-error = 上载失败。 +nfv-package-iui-message-delete-error = 包删除失败。 nfv-package-iui-message-select-vim-error = 最多只能选择一个VIM做为测试环境 nfv-package-iui-onboard-dialog-vimname = VIM名称 nfv-package-iui-product-env = 生产环境 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 3170242b..72d83dfb 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 @@ -21,16 +21,16 @@ var vm = avalon.define({ vimSelectItems : [] }, csarIdSelected : "", - $packageTableFields : {// table columns - table: [ - {"mData": "name", name: $.i18n.prop("nfv-package-iui-field-name")}, - {"mData": "type", name: $.i18n.prop("nfv-package-iui-field-type")}, - {"mData": "size", name: $.i18n.prop("nfv-package-iui-field-size")}, - {"mData": "createTime", name: $.i18n.prop("nfv-package-iui-field-createTime")}, - {"mData": "status", name: $.i18n.prop("nfv-package-iui-field-status"), "fnRender" : pmUtil.statusRender}, - {"mData": null, name: $.i18n.prop("nfv-package-iui-field-operation"), "fnRender" : pmUtil.actionRender} - ] - }, + //$packageTableFields : {// table columns + // table: [ + // {"mData": "name", name: $.i18n.prop("nfv-package-iui-field-name")}, + // {"mData": "type", name: $.i18n.prop("nfv-package-iui-field-type")}, + // {"mData": "size", name: $.i18n.prop("nfv-package-iui-field-size")}, + // {"mData": "createTime", name: $.i18n.prop("nfv-package-iui-field-createTime")}, + // {"mData": "status", name: $.i18n.prop("nfv-package-iui-field-status"), "fnRender" : pmUtil.statusRender}, + // {"mData": null, name: $.i18n.prop("nfv-package-iui-field-operation"), "fnRender" : pmUtil.actionRender} + // ] + //}, $language: { "sProcessing": "  " +$.i18n.prop("nfv-nso-iui-table-sProcess")+"", @@ -51,14 +51,14 @@ var vm = avalon.define({ $restUrl:{ queryPackageInfoUrl: "/openoapi/catalog/v1/csars", uploadPackageUrl: "/openoapi/catalog/v1/csars", - gsarDelPackageUrl: "/openoapi/gsolcm/v1.0/nspackage", + gsarDelPackageUrl: "/openoapi/gso/v1/nspackages", ssarDelPackageUrl: "/openoapi/catalog/v1/csars", - nsarDelPackageUrl: "/openoapi/nslcm/v1.0/nspackage", - nfarDelPackageUrl: "/openoapi/nslcm/v1.0/vnfpackage", - gsarOnboardUrl: "/openoapi/gsolcm/v1.0/nspackage", - ssarOnboardUrl: "/openoapi/nslcm/v1.0/nspackage", - nsarOnboardUrl: "/openoapi/nslcm/v1.0/nspackage", - nfarOnboardUrl: "/openoapi/nslcm/v1.0/vnfpackage", + nsarDelPackageUrl: "/openoapi/nslcm/v1/nspackage", + nfarDelPackageUrl: "/openoapi/nslcm/v1/vnfpackage", + gsarOnboardUrl: "/openoapi/gso/v1/nspackages", + ssarOnboardUrl: "/openoapi/catalog/v1/csars", + nsarOnboardUrl: "/openoapi/nslcm/v1/nspackage", + nfarOnboardUrl: "/openoapi/nslcm/v1/vnfpackage", changePackageStatusUrl : "/openoapi/catalog/v1/csars", queryVimInfoUrl : "/openoapi/extsys/v1/vims" }, @@ -130,11 +130,6 @@ var vm = avalon.define({ labVimId : "", }, $initData : function(csarId) { - //vm.resource.vimSelectItems = [ - // {vimName:"test1", oid:"123456"}, - // {vimName:"test2", oid:"987654"}, - // {vimName:"test3", oid:"123qwe"} - //]; var url=vm.$restUrl.queryVimInfoUrl; commonUtil.get(url,null,function(resp) { if (resp) { @@ -189,28 +184,14 @@ var vm = avalon.define({ if(result) { if(type == "NSAR") { url = vm.$restUrl.nsarDelPackageUrl + "/" + csarId; - //commonUtil.delete(url, function(resp) { - // vm.gotoPackageListPage(); - //}); } else if(type == "NFAR") { url = vm.$restUrl.nfarDelPackageUrl + "/" + csarId; - //commonUtil.delete(url, function(resp) { - // vm.gotoPackageListPage(); - //}); } else if(type == "GSAR") { url = vm.$restUrl.gsarDelPackageUrl + "/" + csarId; - //commonUtil.delete(url, function(resp) { - // vm.gotoPackageListPage(); - //}); } else if(type == "SSAR") { url = vm.$restUrl.ssarDelPackageUrl + "/" + csarId; - //commonUtil.delete(url, function(resp) { - // vm.gotoPackageListPage(); - //}); } - commonUtil.delete(url, function(resp) { - vm.gotoPackageListPage(); - }); + pmUtil.delPackage(url); } }); }, @@ -226,26 +207,28 @@ var vm = avalon.define({ return false; }, - onBoardPackage : function(csarId,type) { + onBoardPackage : function(csarId,type,onBoardState) { var param = { csarId : csarId }; if(type == "NSAR") { - //vm.csarIdSelected = csarId; - //vm.showOnboardDialog(csarId); var url = vm.$restUrl.nsarOnboardUrl; pmUtil.doOnBoard(url, param); } else if(type == "NFAR") { - //var url = vm.$restUrl.nfarOnboardUrl; - //pmUtil.doOnBoard(url, param); vm.csarIdSelected = csarId; vm.showOnboardDialog(csarId); } else if(type == "GSAR") { var url = vm.$restUrl.gsarOnboardUrl; pmUtil.doOnBoard(url, param); } else if(type == "SSAR") { - var url = vm.$restUrl.ssarOnboardUrl; - pmUtil.doOnBoard(url, param); + var ssarTarOnbardState=""; + if(onBoardState =="onBoarded") { + ssarTarOnbardState = "non-onBoarded"; + } else { + ssarTarOnbardState = "onBoarded"; + } + var url = vm.$restUrl.ssarOnboardUrl+"/"+csarId+"?onBoardState="+ssarTarOnbardState + pmUtil.doSSAROnboard(url); } }, showOnboardDialog : function(csarId) { @@ -321,6 +304,7 @@ var vm = avalon.define({ }, gotoPackageListPage:function(){ window.location.href="./csarPackage.html"; + refreshByCond(); } }); avalon.scan(); 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 9b8d10e3..b7b5bbfa 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 @@ -40,54 +40,6 @@ pmUtil.changeTableStatus = function(name, status) { } } -pmUtil.isRowDeletingStatus = function(name) { - var table = $("#" + vm.$tableId).dataTable(); - var tableData = table.fnGetData(); - for (var i=0; i -1) { - return true; - } - } - return false; -} - -pmUtil.delPackage = function(csarId) { - if(pmUtil.isRowDeletingStatus(csarId)){ - return; - } - bootbox.confirm($.i18n.prop("nfv-package-iui-message-delete-confirm"), function(result){ - if(result) { - pmUtil.changeTableStatus(csarId, "deleting"); - var url = vm.$restUrl.delPackageUrl + csarId; - commonUtil.delete(url, function(resp) { - - }); - } - }); -} - -pmUtil.isRowOnBoardingStatus = function(name) { - var table = $("#" + vm.$tableId).dataTable(); - var tableData = table.fnGetData(); - for (var i=0; i -1) { - return true; - } - } - return false; -} - -pmUtil.onBoardPackage = function(name) { - if(pmUtil.isRowOnBoardingStatus(name)){ - return; - } - pmUtil.changeTableStatus(name, "onboarding"); - var url = vm.$restUrl.delPackageUrl + "?csarName=" + name; - commonUtil.delete(url, function(resp) { - }); -} //query packages exist //0: the package does not exist //1: the package does not exist, but the instance cite this package @@ -177,3 +129,32 @@ pmUtil.doNFAROnboard = function(extData) { } }); } + +pmUtil.doSSAROnboard = function(url) { + $.ajax({ + type : "PUT", + url : url, + contentType : "application/json", + success : function(resp) { + refreshByCond(); + }, + error : function() { + commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-onBoard-error"), "failed"); + } + }); +} + +pmUtil.delPackage = function (url) { + $.ajax({ + type : "DELETE", + url : url, + contentType : "application/json", + success : function(resp) { + refreshByCond(); + }, + error : function() { + refreshByCond(); + //commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-error"), "failed"); + } + }); +} -- cgit 1.2.3-korg