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:
DL6ER
2019-06-15 17:20:49 +02:00
committed by Mcat12
parent bb162f6fcd
commit a8b4cb74d8

View File

@@ -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];