new feature data usage hourly

This commit is contained in:
Benjamin Leblond
2019-02-27 20:42:36 +01:00
parent fb003a9e29
commit a295cf87c0
4 changed files with 100 additions and 12 deletions

View File

@@ -9,8 +9,8 @@
element: placeholder,
xkey: 'date',
ykeys: ['rx', 'tx'],
labels: [_t['send']+' '+datasizeunits.toUpperCase(),
_t['receive']+' '+datasizeunits.toUpperCase()]
labels: [_t['receive']+' '+datasizeunits.toUpperCase(),
_t['send']+' '+datasizeunits.toUpperCase()]
});
return barchart;
@@ -31,9 +31,11 @@
*/
function ShowBandwidthChartHandler(e) {
// Remove all morrisjs charts
$('#divChartBandwidthhourly').empty();
$('#divChartBandwidthdaily').empty();
$('#divChartBandwidthmonthly').empty();
// Remove all datatables
$('#divTableBandwidthhourly').empty();
$('#divTableBandwidthdaily').empty();
$('#divTableBandwidthmonthly').empty();
// Construct ajax uri for getting the proper data.
@@ -66,8 +68,8 @@
'order': [[ 0, 'ASC' ]],
'columns': [
{ 'data': 'date' },
{ 'data': 'rx', "title": _t['send']+' '+datasizeunits.toUpperCase() },
{ 'data': 'tx', "title": _t['receive']+' '+datasizeunits.toUpperCase() }]
{ 'data': 'rx', "title": _t['receive']+' '+datasizeunits.toUpperCase() },
{ 'data': 'tx', "title": _t['send']+' '+datasizeunits.toUpperCase() }]
});
}).fail(function(xhr, textStatus) {
if (window.console) {
@@ -80,8 +82,8 @@
$(document).ready(function() {
$('#tabbarBandwidth a[data-toggle="tab"]').on('shown.bs.tab', ShowBandwidthChartHandler);
$('#cbxInterfacehourly').on('change', ShowBandwidthChartHandler);
$('#cbxInterfacedaily').on('change', ShowBandwidthChartHandler);
$('#cbxInterfaceweekly').on('change', ShowBandwidthChartHandler);
$('#cbxInterfacemonthly').on('change', ShowBandwidthChartHandler);
ShowBandwidthChartHandler();
});