mirror of https://github.com/apache/cloudstack.git
Pass dashboard data via dataProvider
This commit is contained in:
parent
9e24af77b9
commit
bd764cc581
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
]
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue