aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjin xin <j00101220@huawei.com>2016-10-21 06:34:47 +0000
committerGerrit Code Review <gerrit@open-o.org>2016-10-21 06:34:47 +0000
commitf1269494ceecc6784a820cb14de602c2f61284a4 (patch)
tree005690d7fb8f87bdf588e45d46cc84a79935ef0b
parent22ec7fe651d6970feed0c480cadb9100ef8374c6 (diff)
parent0490487073c782b0b9eb0d41a7dfb9af693d803c (diff)
Merge changes Id6024a0a,If5b05fbe into sun
* changes: Fix onboard and delete package url, onboard SSAR package calls catalog API. Fix the bug "A message showed in a wrong time when upload package." and modify the css of select vim dialog.
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html28
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/css/package.css9
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-en-US.properties6
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/i18n/nfv-nso-iui-i18n-zh-CN.properties1
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmController.js72
-rw-r--r--openo-portal/portal-catalog/src/main/webapp/catalog/js/package/pmUtil.js79
6 files changed, 99 insertions, 96 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..ecc0b869 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/csarPackage.html
@@ -103,7 +103,7 @@
<td ms-text="res.operationalState"></td>
<td>
<span class="label label-info status" data-toggle="tooltip" title="nfv-package-iui-status-tip"
- ms-click="vm.onBoardPackage(res.csarId,res.type)">
+ ms-click="vm.onBoardPackage(res.csarId,res.type,res.onBoardState)">
{{res.onBoardState}}
</span>
</td>
@@ -117,6 +117,26 @@
</tbody>
</table>
</div>
+ <div class="row-fluid">
+ <div class="col-md-12" style="padding-left:0px;">
+ <div class="pull-left">
+ <small><label>
+ View
+ <select size="1" name="ict_template_table_length" aria-controls="ict_template_table">
+ <option value="10" selected="selected">10</option>
+ <option value="25">25</option>
+ <option value="50">50</option>
+ <option value="100">100</option>
+ </select>
+ records
+ </label>
+ <span id="com_zte_openo_umc_monitor_monitorList_total" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Found total</span>
+ <span ms-text="vm.resource.packageInfo.size()"></span>
+ <span id="com_zte_openo_umc_monitor_monitorList_records" name_i18n="com_zte_openo_umc_monitor_ui_i18n">records</span>
+ </small>
+ </div>
+ </div>
+ </div>
<div id="right-menu" ms-css-display="packageDetail.isShow">
<div>
<div class="title">
@@ -226,7 +246,11 @@
</thead>
<tbody ms-each-rest="resource.vimSelectItems">
<tr>
- <td ms-text="rest.name"></td>
+ <td>
+ <div class="tdCenter">
+ {{rest.name}}
+ </div>
+ </td>
<td>
<div class="checkbox">
<input type="radio" name="testEnvRadios" ms-attr-id="testEnvRadios{{$index}}"
diff --git a/openo-portal/portal-catalog/src/main/webapp/catalog/css/package.css b/openo-portal/portal-catalog/src/main/webapp/catalog/css/package.css
index aa7027bb..a7adcfa0 100644
--- a/openo-portal/portal-catalog/src/main/webapp/catalog/css/package.css
+++ b/openo-portal/portal-catalog/src/main/webapp/catalog/css/package.css
@@ -458,4 +458,13 @@ span.status:hover {
width:100%;
table-layout: fixed;
word-wrap:break-word;
+}
+
+.tdCenter
+{
+ display: block;
+ min-height: 20px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ text-align:center;
} \ No newline at end of file
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 3de07cbd..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
@@ -80,10 +80,11 @@ nfv-package-iui-message-upload-success=Csar package imported successfully.
nfv-package-iui-message-upload-fail=Csar package imported failed.
nfv-package-iui-message-delete-confirm=Do you want to delete the current package?
nfv-package-iui-message-delete-success=Csar package deleted successfully.
-nfv-package-iui-message-upload-csar-exist=The package already exists, whether to re upload?
+nfv-package-iui-message-upload-csar-exist=There is a package in the same name, they may be the same package, whether still upload this package?
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": "<img src='../common/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span>&nbsp;&nbsp;"
+$.i18n.prop("nfv-nso-iui-table-sProcess")+"</span>",
@@ -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 c694c51f..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<tableData.length; i++) {
- if(tableData[i]["name"] == name &&
- tableData[i]["status"].indexOf($.i18n.prop("nfv-package-iui-status-deleting")) > -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<tableData.length; i++) {
- if(tableData[i]["name"] == name &&
- tableData[i]["status"].indexOf($.i18n.prop("nfv-package-iui-status-onboarding")) > -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
@@ -99,7 +51,7 @@ pmUtil.getExistPackageByName = function(name) {
}
var result = $.ajax({
type : "GET",
- url : vm.$restUrl.queryPackageInfoUrl + "?csarName=" + name,
+ url : vm.$restUrl.queryPackageInfoUrl + "?name=" + name,
async: false
});
var data = result.responseJSON;
@@ -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");
+ }
+ });
+}