From 1f07c8c9590135641862d2d5cc310ca05ccd9b89 Mon Sep 17 00:00:00 2001 From: "qin.liang(10184303)" Date: Fri, 18 Aug 2017 11:41:16 +0800 Subject: AAI-181 verification of SDNC portal Change-Id: Idb52ad72ad132a389a021a32fa0764345618bf37 Issue-ID: AAI-181 Signed-off-by: qin.liang(10184303) --- .../webapp/extsys/sdncontroller/js/sdncController.js | 16 +++++++++++++++- esr/src/main/webapp/extsys/sdncontroller/sdncView.html | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'esr/src/main/webapp/extsys/sdncontroller') diff --git a/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js b/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js index 56f22c2..1c9b7bd 100644 --- a/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js +++ b/esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js @@ -107,7 +107,9 @@ var vm = avalon.define({ }, $saveSDNC: function () { var form = $('#vnfm_form'); - //TODO valiate + if(!vm.validate()){ + return; + } vm.server_rtn.info_block = true; vm.server_rtn.warning_block = false; @@ -128,6 +130,18 @@ var vm = avalon.define({ vm.currentElement = vm.sdncList[index]; vm.$showTable(); }, + validate: function () { + var res = true; + var sdncSave = vm.getSDNCSave(); + var url = sdncSave.url; + if(!vm.$format.url.test(url)){ + $("#form_sdnc input[name='url']").next().html("The url format is incorrect"); + res = res && false; + } else { + $("#form_sdnc input[name='url']").next().html(""); + } + return res; + }, delSDNC: function (id, index) { bootbox.confirm($.i18n.prop("nfv-sdnc-iui-message-delete-confirm"), function (result) { if (result) { diff --git a/esr/src/main/webapp/extsys/sdncontroller/sdncView.html b/esr/src/main/webapp/extsys/sdncontroller/sdncView.html index 3cd78a5..6bcb68f 100644 --- a/esr/src/main/webapp/extsys/sdncontroller/sdncView.html +++ b/esr/src/main/webapp/extsys/sdncontroller/sdncView.html @@ -40,7 +40,7 @@