diff --git a/ui/modules/vpc/vpc.js b/ui/modules/vpc/vpc.js index f3cdaf040d5..3c44a4cabca 100644 --- a/ui/modules/vpc/vpc.js +++ b/ui/modules/vpc/vpc.js @@ -234,28 +234,7 @@ var $tier = elems.tier({ context: context, tier: tier, - dashboardItems: [ - { - id: 'tierLoadBalancers', - name: 'Load balancers', - totalMultiLine: '5 Internal
6 Public' - }, - { - id: 'tierPortForwarders', - name: 'Port forwarders', - total: 4 - }, - { - id: 'tierStaticNATs', - name: 'Static NATs', - total: 3 - }, - { - id: 'tierVMs', - name: 'Virtual Machines', - total: 300 - } - ] + dashboardItems: tier._dashboardItems }); $tier.appendTo($tiers); @@ -271,37 +250,16 @@ if (args.complete) { args.complete($chart); } + + // Router + $router = elems.router({ + context: context, + dashboardItems: data.routerDashboard + }).appendTo($chart); } - } + } }); - // Router - $router = elems.router({ - context: context, - 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 - } - ] - }).appendTo($chart); - $chart.bind('reload', function() { chart({ complete: function($newChart) { diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index ce2334ce608..a081ab85667 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -2998,7 +2998,56 @@ }); } } - args.response.success({ tiers: networks }); + args.response.success({ + routerDashboard: [ + { + id: 'privateGateways', + name: 'Private gateways', + total: 0 + }, + { + id: 'publicIPs', + name: 'Public IP addresses', + total: 0 + }, + { + id: 'siteToSiteVPNs', + name: 'Site-to-site VPNs', + total: 0 + }, + { + id: 'networkACLLists', + name: 'Network ACL lists', + total: 0 + } + ], + tiers: $(networks).map(function(index, tier) { + return $.extend(tier, { + _dashboardItems: [ + { + id: 'tierLoadBalancers', + name: 'Load balancers', + totalMultiLine: '0 Internal
0 Public' + }, + { + id: 'tierPortForwarders', + name: 'Port forwarders', + total: 0 + }, + { + id: 'tierStaticNATs', + name: 'Static NATs', + total: 0 + }, + { + id: 'tierVMs', + name: 'Virtual Machines', + total: 0 + } + ] + }); + }) + }); } }); }