diff options
author | Li Zi <li.zi30@zte.com.cn> | 2017-09-29 08:46:57 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-29 08:46:57 +0000 |
commit | 931d61074bcb0f05a3f49241b7b77ac89fba3356 (patch) | |
tree | d3139a3abc8cf04eaee47530029d6b0a0231553b | |
parent | b2a98df1fcee69ccfbab37774a9bc3152529242f (diff) | |
parent | 4019baa23f87cf7ccc52e72d8485fd2d52ab4a1b (diff) |
Merge "validate cloudOwner&cloudRegionId"
-rw-r--r-- | portal/src/main/webapp/extsys/vim/js/vimController.js | 26 | ||||
-rw-r--r-- | portal/src/main/webapp/extsys/vim/vimView.html | 3 |
2 files changed, 27 insertions, 2 deletions
diff --git a/portal/src/main/webapp/extsys/vim/js/vimController.js b/portal/src/main/webapp/extsys/vim/js/vimController.js index e9fd644..6bd6961 100644 --- a/portal/src/main/webapp/extsys/vim/js/vimController.js +++ b/portal/src/main/webapp/extsys/vim/js/vimController.js @@ -106,6 +106,32 @@ var vm = avalon if (form.valid() == false) { vm.isSave = false; return false; + } else { + vm.isSave = true; + } + var cloudOwner = vm.currentElement["cloudOwner"]; + var $cloudOwner = $("#vim_form input[name='cloudOwner']"); + var cloudRegionId = vm.currentElement["cloudRegionId"]; + var $cloudRegionId = $("#vim_form input[name='cloudRegionId']"); + if(cloudOwner.indexOf("_") != -1){ + $cloudOwner.parent().parent().addClass("has-error"); + $cloudOwner.next().html("It not allowed '_' contained here").show(); + vm.isSave = false; + return false; + } else { + vm.isSave = true; + $cloudOwner.parent().parent().removeClass("has-error"); + $cloudOwner.next().hide(); + } + if(cloudRegionId.indexOf("_") != -1){ + $cloudRegionId.parent().parent().addClass("has-error"); + $cloudRegionId.next().html("It not allowed '_' contained here").show(); + vm.isSave = false; + return false; + } else { + vm.isSave = true; + $cloudRegionId.parent().parent().removeClass("has-error"); + $cloudRegionId.next().hide(); } var res = false; if (vm.saveType == "add") { diff --git a/portal/src/main/webapp/extsys/vim/vimView.html b/portal/src/main/webapp/extsys/vim/vimView.html index c75cdee..b0623ef 100644 --- a/portal/src/main/webapp/extsys/vim/vimView.html +++ b/portal/src/main/webapp/extsys/vim/vimView.html @@ -211,8 +211,7 @@ <div class="row-fluid col-sm-12" data-name="cond_zone"> <div class="col-sm-4"> <button class="btn white radius_l" id="app-new-btn" ms-click="$showVimTable(-1, 'add')"> - <i class="ict-new"></i> <span id_i18n="com_zte_ums_eco_roc_vim_register" - name_i18n="com_zte_conductor_ui_i18n"></span> + <i class="ict-new"></i> <span id_i18n="com_zte_ums_eco_roc_vim_register" name_i18n="com_zte_conductor_ui_i18n"></span> </button> </div> <!-- <div class="fa fa-refresh text-muted refresh-status-text"><small><span id_i18n="com_zte_ums_eco_roc_vim_status_update_time" name_i18n="com_zte_conductor_ui_i18n"></span></small><small ms-text="vimStatusTime"></small></div>--> |