From 4019baa23f87cf7ccc52e72d8485fd2d52ab4a1b Mon Sep 17 00:00:00 2001 From: 覃亮10184303 Date: Fri, 29 Sep 2017 16:25:18 +0800 Subject: validate cloudOwner&cloudRegionId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue-ID: AAI-186 Change-Id: I8c0a8a4f87ce998206d2c2d5b4162043c78580d0 Signed-off-by: 覃亮10184303 --- .../src/main/webapp/extsys/vim/js/vimController.js | 26 ++++++++++++++++++++++ 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 923ddf7..33715ed 100644 --- a/portal/src/main/webapp/extsys/vim/vimView.html +++ b/portal/src/main/webapp/extsys/vim/vimView.html @@ -211,8 +211,7 @@
-- cgit 1.2.3-korg