mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Merge branch 'devel' into FTLDNS
This commit is contained in:
@@ -178,6 +178,23 @@ function updateQueryTypesPie() {
|
||||
queryTypePieChart.update();
|
||||
// Don't use rotation animation for further updates
|
||||
queryTypePieChart.options.animation.duration=0;
|
||||
// Generate legend in separate div
|
||||
$("#query-types-legend").html(queryTypePieChart.generateLegend());
|
||||
$("#query-types-legend > ul > li").on("click",function(e){
|
||||
$(this).toggleClass("strike");
|
||||
var index = $(this).index();
|
||||
var ci = e.view.queryTypePieChart;
|
||||
var meta = ci.data.datasets[0]._meta;
|
||||
for(let i in meta)
|
||||
{
|
||||
if ({}.hasOwnProperty.call(meta, i))
|
||||
{
|
||||
var curr = meta[i].data[index];
|
||||
curr.hidden = !curr.hidden;
|
||||
}
|
||||
}
|
||||
ci.update();
|
||||
});
|
||||
}).done(function() {
|
||||
// Reload graph after minute
|
||||
setTimeout(updateQueryTypesPie, 60000);
|
||||
@@ -392,6 +409,23 @@ function updateForwardDestinationsPie() {
|
||||
forwardDestinationPieChart.update();
|
||||
// Don't use rotation animation for further updates
|
||||
forwardDestinationPieChart.options.animation.duration=0;
|
||||
// Generate legend in separate div
|
||||
$("#forward-destinations-legend").html(forwardDestinationPieChart.generateLegend());
|
||||
$("#forward-destinations-legend > ul > li").on("click",function(e){
|
||||
$(this).toggleClass("strike");
|
||||
var index = $(this).index();
|
||||
var ci = e.view.forwardDestinationPieChart;
|
||||
var meta = ci.data.datasets[0]._meta;
|
||||
for(let i in meta)
|
||||
{
|
||||
if ({}.hasOwnProperty.call(meta, i))
|
||||
{
|
||||
var curr = meta[i].data[index];
|
||||
curr.hidden = !curr.hidden;
|
||||
}
|
||||
}
|
||||
ci.update();
|
||||
});
|
||||
}).done(function() {
|
||||
// Reload graph after one minute
|
||||
setTimeout(updateForwardDestinationsPie, 60000);
|
||||
@@ -960,8 +994,7 @@ $(document).ready(function() {
|
||||
},
|
||||
options: {
|
||||
legend: {
|
||||
display: true,
|
||||
position: "right"
|
||||
display: false
|
||||
},
|
||||
tooltips: {
|
||||
enabled: true,
|
||||
@@ -998,8 +1031,7 @@ $(document).ready(function() {
|
||||
},
|
||||
options: {
|
||||
legend: {
|
||||
display: true,
|
||||
position: "right"
|
||||
display: false
|
||||
},
|
||||
tooltips: {
|
||||
enabled: true,
|
||||
|
||||
Reference in New Issue
Block a user