Updated Branches:
  refs/heads/ui-vpc-redesign d00077ab7 -> 2eb29a5d8

Create panel on click of dashboard item


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

Branch: refs/heads/ui-vpc-redesign
Commit: 3f22b6a3e584002f19f5fa1877c57158b65b598c
Parents: d00077a
Author: Brian Federle <[email protected]>
Authored: Fri May 10 15:15:45 2013 -0700
Committer: Brian Federle <[email protected]>
Committed: Fri May 10 15:15:45 2013 -0700

----------------------------------------------------------------------
 ui/modules/vpc/vpc.js |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3f22b6a3/ui/modules/vpc/vpc.js
----------------------------------------------------------------------
diff --git a/ui/modules/vpc/vpc.js b/ui/modules/vpc/vpc.js
index 2b01648..a3922b3 100644
--- a/ui/modules/vpc/vpc.js
+++ b/ui/modules/vpc/vpc.js
@@ -55,11 +55,29 @@
         var $dashboardItem = $('<div>').addClass('dashboard-item');
         var $name = $('<div>').addClass('name').append($('<span>'));
         var $total = $('<div>').addClass('total').append($('<span>'));
+        var id = dashboardItem.id;
 
         $name.find('span').html(dashboardItem.name);
         $total.find('span').html(dashboardItem.total);
         $dashboardItem.append($total, $name);
         $dashboardItem.appendTo($dashboard);
+
+        $dashboardItem.click(function() {
+          $('#browser .container').cloudBrowser('addPanel', {
+            title: dashboardItem.name,
+            maximizeIfSelected: true,
+            complete: function($panel) {
+              var section = cloudStack.vpc.sections[id];
+              var $section = $('<div>');
+
+              if (section.listView) {
+                $section.listView(section);
+              }
+
+              $section.appendTo($panel);
+            }
+          });
+        });
       });
 
       return $dashboard;
@@ -92,18 +110,22 @@
                 tier: tier,
                 dashboardItems: [
                   {
+                    id: 'tierLoadBalancers',
                     name: 'Load balancers',
                     total: 5
                   },
                   {
+                    id: 'tierPortForwarders',
                     name: 'Port forwarders',
                     total: 4
                   },
                   {
+                    id: 'tierStaticNATs',
                     name: 'Static NATs',
                     total: 3
                   },
                   {
+                    id: 'tierVMs',
                     name: 'Virtual Machines',
                     total: 300
                   }
@@ -123,18 +145,22 @@
       $router = elems.router({
         dashboardItems: [
           {
+            id: 'privateGateways',
             name: 'Private gateways',
             total: 1
           },
           {
+            id: 'publicIPs',
             name: 'Public IP addresses',
             total: 2
           },
           {
+            id: 'siteToSiteVPNs',
             name: 'Site-to-site VPNs',
             total: 3
           },
           {
+            id: 'networkACLLists',
             name: 'Network ACL lists',
             total: 2
           }

Reply via email to