diff options
author | nancylizi <li.zi30@zte.com.cn> | 2016-11-01 14:13:10 +0800 |
---|---|---|
committer | Li Zi <li.zi30@zte.com.cn> | 2016-11-01 06:12:52 +0000 |
commit | 7eaafe9c63dc6b322360c05f12ec4b28b1b3f2d2 (patch) | |
tree | 1fabcee2b69dca11219440d50047ba7d20a744fa | |
parent | 7a6ce540bfc33995ef594da65b380e219055ea06 (diff) |
Modify the alert message while delete package.
Change-Id: I4bc61b17e3574526387ef04ccf1e0129b16a2636
Issue-id:GSO-90
Signed-off-by: nancylizi <li.zi30@zte.com.cn>
3 files changed, 31 insertions, 7 deletions
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 5e9b97bf..7c2d1303 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 @@ -89,6 +89,9 @@ nfv-package-iui-message-select-vim-error = Can not select more than one VIM to b nfv-package-iui-onboard-dialog-vimname = VIM Name
nfv-package-iui-product-env = Product Environment
nfv-package-iui-test-env = Test Environment
+nfv-package-iui-http-delete-error = Delete package from HTTP server failed!
+nfv-package-iui-template-delete-error = Delete template data failed!
+nfv-package-iui-package-delete-error = Delete package data failed!
nfv-package-iui-drop-zone-title=Drag & drop files here …
nfv-package-iui-drop-zone-selectBtn=Browse
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 efb19162..1d3e6cfe 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 @@ -90,6 +90,9 @@ nfv-package-iui-message-select-vim-error = 最多只能选择一个VIM做为测 nfv-package-iui-onboard-dialog-vimname = VIM名称
nfv-package-iui-product-env = 生产环境
nfv-package-iui-test-env = 测试环境
+nfv-package-iui-http-delete-error = 从HTTP服务器上删除包失败!
+nfv-package-iui-template-delete-error = 删除模板数据失败!
+nfv-package-iui-package-delete-error = 删除包数据失败!
nfv-package-iui-drop-zone-title=拖拽文件到这里 …
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 80067abc..db21456f 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 @@ -71,8 +71,18 @@ pmUtil.updateDeletedPackageStatus = function(message) { if(messageobj.status == "true" || messageobj.status == "deletionPending") {
commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-success"), "success");
refreshByCond();
- } else {
+ } else if (messageobj.status == "Delete package from HTTP server failed!") {
pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-http-delete-error"), "failed");
+ } else if (messageobj.status == "Delete template data failed!") {
+ pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-template-delete-error"), "failed");
+ } else if (messageobj.status == "Delete package data failed!") {
+ pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-package-delete-error"), "failed");
+ } else if (messageobj.status == "false") {
+ pmUtil.changeTableStatus(messageobj.csarid, "deletefail");
+ commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-error"), "failed");
}
}
@@ -168,15 +178,11 @@ pmUtil.delPackage = function (url) { url : url,
contentType : "application/json",
success : function(resp) {
- //commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-success"), "success");
- //setTimeout( function(){
- // refreshByCond();
- //}, 1 * 1000 );
+
},
error : function(resp) {
if(resp.status == 202 || resp.responseText == "success") {
- //commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-success"), "success");
- //refreshByCond();
+
} else {
commonUtil.showMessage($.i18n.prop("nfv-package-iui-message-delete-error"), "failed");
refreshByCond();
@@ -185,6 +191,18 @@ pmUtil.delPackage = function (url) { });
}
+pmUtil.isRowDeletingStatus = function(csarId) {
+ var table = $("#" + vm.$tableId).dataTable();
+ var tableData = table.fnGetData();
+ for (var i=0; i<tableData.length; i++) {
+ if(tableData[i]["csarId"] == csarId &&
+ tableData[i]["status"].indexOf($.i18n.prop("nfv-package-iui-status-deleting")) > -1) {
+ return true;
+ }
+ }
+ return false;
+}
+
pmUtil.nameRender = function(obj) {
return '<a href="#" onclick="vm.packageDetail.$showDetails('
+ '\'block\',\'' + obj.aData.csarId + '\', \'' + obj.aData.name + '\')">' + obj.aData.name + '</a>';
|