cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject [35/50] git commit: updated refs/heads/master to b03e419
Date Tue, 28 May 2013 07:59:20 GMT
Add dashboard count for IPs with port forwarding


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

Branch: refs/heads/master
Commit: 9e0733c83e2204f6ca313cfa210a7ffd008524eb
Parents: 763f6fd
Author: Brian Federle <bfederle@gmail.com>
Authored: Wed May 22 12:28:02 2013 -0700
Committer: Brian Federle <bfederle@gmail.com>
Committed: Wed May 22 12:28:02 2013 -0700

----------------------------------------------------------------------
 ui/scripts/vpc.js |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9e0733c8/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index eeb6950..fe3ce13 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -3106,7 +3106,7 @@
           async: true,
           success: function(json) {
             var networks = json.listnetworksresponse.network;
-            var loadBalancers, networkACLLists, publicIpAddresses, privateGateways, vpnGateways;
+            var loadBalancers, networkACLLists, publicIpAddresses, privateGateways, vpnGateways,
portForwardingRules;
             var error = false;
 
             // Get load balancers
@@ -3148,6 +3148,19 @@
               }
             });
 
+            // Get port forwarding rules
+            $.ajax({
+              url: createURL('listPortForwardingRules'),
+              data: { 'vpcid': args.context.vpc[0].id },
+              success: function(json) {
+                portForwardingRules = json.listportforwardingrulesresponse.portforwardingrule
?
+                  json.listportforwardingrulesresponse.portforwardingrule : [];
+              },
+              error: function(json) {
+                error = true;
+              }
+            });
+
             // Get private gateways
             $.ajax({
               url: createURL('listPrivateGateways'),
@@ -3234,7 +3247,14 @@
                         {
                           id: 'tierPortForwarders',
                           name: 'Port forwarders',
-                          total: 0
+                          total: $.grep(publicIpAddresses, function(ip) {
+                            return $.grep(
+                              portForwardingRules,
+                              function(pf) {
+                                return pf.ipaddressid == ip.id;
+                              }
+                            ).length ? true : false;
+                          }).length
                         },
                         {
                           id: 'tierStaticNATs',


Mime
View raw message