mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Check data before converting. This allows us to detect if there is no data for the graph so we can hide it. Fixes #932
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -261,15 +261,16 @@ function updateClientsOverTime() {
|
||||
return;
|
||||
}
|
||||
|
||||
// convert received objects to arrays
|
||||
data.over_time = objectToArray(data.over_time);
|
||||
|
||||
// Remove graph if there are no results (e.g. privacy mode enabled)
|
||||
if(jQuery.isEmptyObject(data.over_time))
|
||||
{
|
||||
$("#clients").parent().remove();
|
||||
return;
|
||||
}
|
||||
|
||||
// convert received objects to arrays
|
||||
data.over_time = objectToArray(data.over_time);
|
||||
|
||||
// remove last data point since it not representative
|
||||
data.over_time[0].splice(-1,1);
|
||||
var timestamps = data.over_time[0];
|
||||
|
||||
Reference in New Issue
Block a user