From 5bfc39f1e6befe01563be95d3e40fd7b5f7e14fe Mon Sep 17 00:00:00 2001 From: nancylizi Date: Thu, 27 Oct 2016 14:57:37 +0800 Subject: Fix the bug "delete package, package table would not be refreshed". Change-Id: Ia2311b7e5e0ecc0f072ab03d064a55764a60d886 Issue-id:GSO-50 Signed-off-by: nancylizi --- .../src/main/webapp/catalog/csarPackage.html | 1 + .../main/webapp/catalog/js/package/pmController.js | 7 +++- .../src/main/webapp/catalog/js/package/pmUtil.js | 41 +++++++++++++--------- 3 files changed, 31 insertions(+), 18 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 fc427394..6c547ce1 100644 --- a/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html +++ b/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html @@ -226,6 +226,7 @@ + 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 9129b9d3..3b19d23e 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 @@ -326,6 +326,11 @@ var vm = avalon.define({ } }); }, + $initCometd : function() { + commonUtil.registerCometdMessage("/openoapi/catalog/v1/catalognotification", "/package/delete", function(message) { + pmUtil.updateDeletedPackageStatus(message); + }); + }, gotoPackageListPage:function(){ window.location.href="./csarPackage.html"; refreshByCond(); @@ -333,7 +338,7 @@ var vm = avalon.define({ }); avalon.scan(); vm.$initUpload(); - +vm.$initCometd(); $(function(){ vm.$initTable(); }); 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 79dd813b..ccd0f11b 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 @@ -29,11 +29,11 @@ pmUtil.changeStatus = function(csarId, status) { }); } -pmUtil.changeTableStatus = function(name, status) { +pmUtil.changeTableStatus = function(csarId, status) { var table = $("#" + vm.$tableId).dataTable(); var tableData = table.fnGetData(); for (var i=0; i