Pass dashboard data via dataProvider

This commit is contained in:
Brian Federle 2013-05-20 13:55:43 -07:00
parent 9e24af77b9
commit bd764cc581
2 changed files with 58 additions and 51 deletions

View File

@ -234,28 +234,7 @@
var $tier = elems.tier({
context: context,
tier: tier,
dashboardItems: [
{
id: 'tierLoadBalancers',
name: 'Load balancers',
totalMultiLine: '5 Internal<br/>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) {

View File

@ -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<br/>0 Public'
},
{
id: 'tierPortForwarders',
name: 'Port forwarders',
total: 0
},
{
id: 'tierStaticNATs',
name: 'Static NATs',
total: 0
},
{
id: 'tierVMs',
name: 'Virtual Machines',
total: 0
}
]
});
})
});
}
});
}