Query physical location id when register VIM. 01/33601/1
authorLiZi <li.zi30@zte.com.cn>
Thu, 1 Mar 2018 11:37:23 +0000 (06:37 -0500)
committerLiZi <li.zi30@zte.com.cn>
Thu, 1 Mar 2018 11:37:36 +0000 (06:37 -0500)
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>
portal/src/main/webapp/extsys/vim/i18n/roc-vim-iui-i18n-en-US.properties
portal/src/main/webapp/extsys/vim/i18n/roc-vim-iui-i18n-zh-CN.properties
portal/src/main/webapp/extsys/vim/js/vimController.js
portal/src/main/webapp/extsys/vim/vimView.html

index de4baa3..3c4bed2 100644 (file)
@@ -58,7 +58,9 @@ com_zte_ums_eco_roc_vim_growl_msg_remove_success=delete success
 com_zte_ums_eco_roc_vim_growl_msg_remove_failed=delete failed
 com_zte_ums_eco_roc_vim_growl_msg_remove_server_success=delete server success:
 com_zte_ums_eco_roc_vim_growl_msg_remove_server_failed=delete server falied:
-com_zte_ums_eco_roc_vim_growl_msg_query_failed=query faile
+com_zte_ums_eco_roc_vim_growl_msg_query_failed=query failed
+com_zte_ums_eco_roc_vim_growl_msg_query_vim_type_failed=query VIM type failed
+com_zte_ums_eco_roc_vim_growl_msg_query_complex_failed=query Physical Location Id failed
 
 com_zte_ums_eco_roc_vim_growl_msg_save_success=save success
 com_zte_ums_eco_roc_vim_growl_msg_save_failed=save failed
index dec6e8d..ab65b8f 100644 (file)
@@ -64,6 +64,8 @@ com_zte_ums_eco_roc_vim_growl_msg_save_failed=保存失败
 com_zte_ums_eco_roc_vim_growl_msg_remove_server_success=删除Server成功:
 com_zte_ums_eco_roc_vim_growl_msg_remove_server_failed=删除Server失败:
 com_zte_ums_eco_roc_vim_growl_msg_query_failed=查询失败
+com_zte_ums_eco_roc_vim_growl_msg_query_vim_type_failed=查询 VIM type 失败
+com_zte_ums_eco_roc_vim_growl_msg_query_complex_failed=查询 Physical Location Id 失败
 com_zte_ums_eco_roc_vim_growl_msg_add_server_success=增加Server成功,端口号:
 com_zte_ums_eco_roc_vim_growl_msg_add_server_failed=增加Server失败:
 
index 4d85c21..73a5bc5 100644 (file)
@@ -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"]) {
index 8e0e06d..0dce392 100644 (file)
                             </div>
                             <div class="form-group">
                                 <label class="control-label col-sm-3">
-                                    <span>Complex Name</span>
+                                    <span>Physical Location Id</span>
                                     <span class="required" aria-required="true">*</span>
                                 </label>
                                 <div class="col-sm-7">
-                                    <input type="text" ms-duplex="currentElement['complexName']" name="complexName" class="form-control"/>
+                                    <select ms-duplex="currentElement['physicalLocationId']">
+                                        <option value="null"></option>
+                                        <option ms-repeat="physicalLocationIds">{{el}}</option>
+                                    </select>
                                     <span class="help-block"></span>
                                 </div>
                             </div>