summaryrefslogtreecommitdiffstats
path: root/portal/src/main/webapp/extsys/vim/js
diff options
context:
space:
mode:
authorLiZi <li.zi30@zte.com.cn>2018-03-01 06:37:23 -0500
committerLiZi <li.zi30@zte.com.cn>2018-03-01 06:37:36 -0500
commit691dad98bb05d412b7c0e293bbf7bb73399fdd4d (patch)
tree9c3de360eb47b2dd6306e85b0a3d3c2303786db5 /portal/src/main/webapp/extsys/vim/js
parent7f8acd1a0a8ddd3f6aac2301d2499c037ab53557 (diff)
Query physical location id when register VIM.
Query physical location id when register VIM. Change the original complex name into physical location id. Change-Id: I29e4cd634e6ec58688864ef7bfc55597ab4ef59f Issue-ID: AAI-828 Signed-off-by: LiZi <li.zi30@zte.com.cn>
Diffstat (limited to 'portal/src/main/webapp/extsys/vim/js')
-rw-r--r--portal/src/main/webapp/extsys/vim/js/vimController.js34
1 files changed, 30 insertions, 4 deletions
diff --git a/portal/src/main/webapp/extsys/vim/js/vimController.js b/portal/src/main/webapp/extsys/vim/js/vimController.js
index 4d85c21..73a5bc5 100644
--- a/portal/src/main/webapp/extsys/vim/js/vimController.js
+++ b/portal/src/main/webapp/extsys/vim/js/vimController.js
@@ -31,7 +31,7 @@ var vm = avalon
"cloudRegionVersion": "v1.0",
"ownerDefinedType": "",
"cloudZone": "",
- "complexName": "",
+ "physicalLocationId": "",
"cloudExtraInfo": "",
"vimAuthInfos": [
{
@@ -48,6 +48,7 @@ var vm = avalon
vimTypeObj: [],
vimTypes: [],
vimVersions:[],
+ physicalLocationIds:[],
$Status: {
success: "active",
failed: "inactive",
@@ -60,6 +61,7 @@ var vm = avalon
$addVimInfoUrl: '/api/aai-esr-server/v1/vims',
$updateVimInfoUrl: '/api/aai-esr-server/v1/vims/{cloudOwner}/{cloudRegionId}',
$delVimInfoUrl: '/api/aai-esr-server/v1/vims/{cloudOwner}/{cloudRegionId}',
+ $queryComplexInfoUrl: '/api/aai-esr-server/v1/vims/complexes',
$queryVimTypeUrl: '/multicloud/v0/vim_types',
$initTable: function () {
$.ajax({
@@ -96,6 +98,7 @@ var vm = avalon
vm.fillElement(vm.vimInfo[index], vm.currentElement);
}
vm.$showModal();
+ vm.getPhysicalLocationIds();
vm.getVimTypes();
},
$showModal: function () {
@@ -253,7 +256,7 @@ var vm = avalon
targetElement["cloudRegionVersion"] = sourceElement["cloudRegionVersion"];
targetElement["ownerDefinedType"] = sourceElement["ownerDefinedType"];
targetElement["cloudZone"] = sourceElement["cloudZone"];
- targetElement["complexName"] = sourceElement["complexName"];
+ targetElement["physicalLocationId"] = sourceElement["physicalLocationId"];
targetElement["cloudExtraInfo"] = sourceElement["cloudExtraInfo"];
if(!targetElement["vimAuthInfos"]){
targetElement["vimAuthInfos"] = [{}];
@@ -293,12 +296,12 @@ var vm = avalon
}
else {
vm.vimTypeObj = [];
- bootbox.alert($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_query_failed"));
+ bootbox.alert($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_query_vim_type_failed"));
return;
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
- bootbox.alert($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_query_failed") + textStatus + ":" + errorThrown);
+ bootbox.alert($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_query_vim_type_failed") + textStatus + ":" + errorThrown);
return;
},
complete: function () {
@@ -307,6 +310,29 @@ var vm = avalon
});
vm.getVimVerions(vm.vimTypeObj[0]["vim_type"]);
},
+ getPhysicalLocationIds: function(){
+ $.ajax({
+ "type": 'get',
+ "url": vm.$queryComplexInfoUrl,
+ "success": function (resp, statusText, jqXHR) {
+ if (jqXHR.status == "200") {
+ vm.physicalLocationIds = resp;
+ }
+ else {
+ vm.physicalLocationIds = [];
+ bootbox.alert($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_query_complex_failed"));
+ return;
+ }
+ },
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
+ bootbox.alert($.i18n.prop("com_zte_ums_eco_roc_vim_growl_msg_query_complex_failed") + textStatus + ":" + errorThrown);
+ return;
+ },
+ complete: function () {
+ resUtil.tooltipVimStatus();
+ }
+ });
+ },
getVimVerions: function(vim_type){
for (var i=0;i<vm.vimTypeObj.length;i++) {
if(vim_type == vm.vimTypeObj[i]["vim_type"]) {