summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqin.liang(10184303) <qin.liang13@zte.com.cn>2017-08-18 11:41:16 +0800
committerqin.liang(10184303) <qin.liang13@zte.com.cn>2017-08-18 11:43:33 +0800
commit1f07c8c9590135641862d2d5cc310ca05ccd9b89 (patch)
tree7a07634bf0dbac0b91fb441692be8d28f3a42377
parentd99cfa04b304311fea4cfeabf71811a5359cd9ae (diff)
AAI-181 verification of SDNC portal
Change-Id: Idb52ad72ad132a389a021a32fa0764345618bf37 Issue-ID: AAI-181 Signed-off-by: qin.liang(10184303) <qin.liang13@zte.com.cn>
-rw-r--r--esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js16
-rw-r--r--esr/src/main/webapp/extsys/sdncontroller/sdncView.html3
2 files changed, 16 insertions, 3 deletions
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 @@
</div>
<div class="modal-body">
<div class="step-content">
- <form class="form-horizontal" role="form">
+ <form class="form-horizontal" role="form" id="form_sdnc">
<div class="form-group">
<label class="control-label col-sm-3">
<span>Name</span>
@@ -59,7 +59,6 @@
<div class="col-sm-7">
<input type="text" ms-duplex="currentElement.url" name="url" class="form-control"/>
<span class="help-block"></span>
- <span class="help-block"></span>
</div>
</div>
<div class="form-group">