mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
(dashboard, widgets) optional number of measures in traffic_graphs.widget.php
This commit is contained in:
parent
8decc7a38f
commit
556dc7384a
@ -38,11 +38,14 @@
|
||||
var traffic_graph_widget_chart_out = null;
|
||||
var traffic_graph_widget_chart_data_out = null;
|
||||
|
||||
function traffic_widget_update(sender, data)
|
||||
function traffic_widget_update(sender, data, max_measures)
|
||||
{
|
||||
// push new measurement, keep a maximum of 100 measures in
|
||||
if (max_measures == undefined) {
|
||||
max_measures = 100;
|
||||
}
|
||||
// push new measurement, keep a maximum of max_measures measures in
|
||||
traffic_graph_widget_data.push(data);
|
||||
if (traffic_graph_widget_data.length > 100) {
|
||||
if (traffic_graph_widget_data.length > max_measures) {
|
||||
traffic_graph_widget_data.shift();
|
||||
} else if (traffic_graph_widget_data.length == 1) {
|
||||
traffic_graph_widget_data.push(data);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user