cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: updated refs/heads/4.2 to 62eb115
Date Wed, 10 Jul 2013 22:28:10 GMT
Updated Branches:
  refs/heads/4.2 4c597ab78 -> 62eb11591


CLOUDSTACK-2983: Fix protocol number field passing invalid values

Conflicts:
	ui/scripts/vpc.js


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

Branch: refs/heads/4.2
Commit: 62eb115911fc309304b48796373f397d4a329856
Parents: 4c597ab
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:28:07 2013 -0700

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/62eb1159/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 9ea5a82..7c8cfa3 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -181,6 +181,7 @@
                 $icmpFields.hide();
                 $otherFields.hide();
                 $protocolFields.show().addClass('required');
+                $inputs.filter('[name=startport],[name=endport]').show().attr('disabled',
false);
               } else if ($(this).val() == 'icmp') {
                 $icmpFields.show();
                 $icmpFields.attr('disabled', false);
@@ -285,25 +286,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