mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
Remove clients over time graph if no data is returned (privacy mode!)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -294,6 +294,13 @@ function updateClientsOverTime() {
|
||||
|
||||
// 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;
|
||||
}
|
||||
// remove last data point since it not representative
|
||||
data.over_time[0].splice(-1,1);
|
||||
var timestamps = data.over_time[0];
|
||||
@@ -492,6 +499,7 @@ function updateTopClientsChart() {
|
||||
if(jQuery.isEmptyObject(data.top_sources))
|
||||
{
|
||||
$("#client-frequency").parent().remove();
|
||||
return;
|
||||
}
|
||||
|
||||
$("#client-frequency .overlay").hide();
|
||||
@@ -535,6 +543,7 @@ function updateTopLists() {
|
||||
if(jQuery.isEmptyObject(data.top_queries))
|
||||
{
|
||||
$("#domain-frequency").parent().remove();
|
||||
return;
|
||||
}
|
||||
|
||||
for (domain in data.top_ads) {
|
||||
@@ -558,6 +567,7 @@ function updateTopLists() {
|
||||
if(jQuery.isEmptyObject(data.top_ads))
|
||||
{
|
||||
$("#ad-frequency").parent().remove();
|
||||
return;
|
||||
}
|
||||
|
||||
$("#domain-frequency .overlay").hide();
|
||||
|
||||
Reference in New Issue
Block a user