incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: CS-16572: Fix missing fields when start port == 0
Date Mon, 22 Oct 2012 23:49:26 GMT
Updated Branches:
  refs/heads/master db165896d -> 7fda33bbd


CS-16572: Fix missing fields when start port == 0


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

Branch: refs/heads/master
Commit: 7fda33bbd0c5f9a8017686611d13ea52dd40b6df
Parents: db16589
Author: Brian Federle <brian.federle@citrix.com>
Authored: Mon Oct 22 16:44:17 2012 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Mon Oct 22 16:49:19 2012 -0700

----------------------------------------------------------------------
 ui/scripts/network.js |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/7fda33bb/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index d434265..f1d46ed 100644
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -3647,14 +3647,24 @@
                           data: $.map(
                             data.listsecuritygroupsresponse.securitygroup[0].egressrule ?

                               data.listsecuritygroupsresponse.securitygroup[0].egressrule
: [],
+                            
                             function(elem) {
-                              return {
+                              var elemData = {
                                 id: elem.ruleid,
                                 protocol: elem.protocol,
-                                startport: elem.startport ? elem.startport : elem.icmptype,
-                                endport: elem.endport ? elem.endport : elem.icmpcode,
+                                startport: elem.startport,
+                                endport: elem.endport,
                                 cidr: elem.cidr ? elem.cidr : ''.concat(elem.account, ' -
', elem.securitygroupname)
                               };
+
+                              if (elemData.startport == 0 && elemData.endport) {
+                                elemData.startport = '0';
+                              } else if (elem.icmptype && elem.icmpcode) {
+                                elemData.startport = elem.icmptype;
+                                elemData.endport = elem.icmpcode;
+                              }
+
+                              return elemData;
                             }
                           )
                         });


Mime
View raw message