cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [08/50] git commit: updated refs/heads/sdnextensions to bcfb4e6
Date Fri, 12 Jul 2013 07:51:03 GMT
CLOUDSTACK-2983: Fix protocol number field passing invalid values


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ef7d2740
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ef7d2740
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ef7d2740

Branch: refs/heads/sdnextensions
Commit: ef7d2740bdd04c217f92742941a7d44b1a87c40d
Parents: 7ea8c5f
Author: Brian Federle <brian.federle@citrix.com>
Authored: Wed Jul 10 15:26:58 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Wed Jul 10 15:27:03 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef7d2740/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index b93328f..17ea65e 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -185,7 +185,7 @@
                 $icmpFields.hide();
                 $otherFields.hide();
                 $protocolFields.show().addClass('required');
-                $portFields.show();
+                $inputs.filter('[name=startport],[name=endport]').show().attr('disabled',
false);
               } else if ($(this).val() == 'icmp') {
                 $icmpFields.show();
                 $icmpFields.attr('disabled', false);
@@ -292,25 +292,27 @@
       action: function(args) {
         var $multi = args.$multi;
         //Support for Protocol Number between 0 to 255
-        if(args.data.protocol == 'protocolnumber'){
+        if (args.data.protocol === 'protocolnumber'){
           $.extend(args.data,{protocol:args.data.protocolnumber});
           delete args.data.protocolnumber;
-        }
-        else
+          delete args.data.startport;
+          delete args.data.endport;
+          delete args.data.icmptype;
+          delete args.data.icmpcode;
+        } else {
           delete args.data.protocolnumber;
+        }
 
-
-        
-        if((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.startport==""
|| args.data.startport == undefined)){
+        if ((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.startport==""
|| args.data.startport == undefined)){
           cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be
blank')});
           $(window).trigger('cloudStack.fullRefresh');
         }
-        else if((args.data.protocol == 'tcp' || args.data.protocol == 'udp')  &&
(args.data.endport=="" || args.data.endport == undefined)){
+        else if ((args.data.protocol == 'tcp' || args.data.protocol == 'udp')  &&
(args.data.endport=="" || args.data.endport == undefined)){
           cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be
blank')});
           $(window).trigger('cloudStack.fullRefresh');
         }
 
-        else{       
+        else {
           $.ajax({
             url: createURL('createNetworkACL'),
             data: $.extend(args.data, {


Mime
View raw message