mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
webui: Updated pi-hole graphs for better grouping (#7179)
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require 'includes/graphs/common.inc.php';
|
||||||
|
|
||||||
|
$scale_min = 0;
|
||||||
|
$scale_max = 100;
|
||||||
|
$colours = 'mixed';
|
||||||
|
$unit_text = 'Stats';
|
||||||
|
$unitlen = 6;
|
||||||
|
$bigdescrlen = 25;
|
||||||
|
$smalldescrlen = 25;
|
||||||
|
$dostack = 0;
|
||||||
|
$printtotal = 0;
|
||||||
|
$addarea = 1;
|
||||||
|
$transparency = 33;
|
||||||
|
$rrd_filename = rrd_name($device['hostname'], array('app', $app['app_type'], $app['app_id']));
|
||||||
|
|
||||||
|
$array = array(
|
||||||
|
'ads_percentage' => array('descr' => 'ADs blocked %','colour' => '912925',),
|
||||||
|
);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||||
|
foreach ($array as $ds => $var) {
|
||||||
|
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||||
|
$rrd_list[$i]['descr'] = $var['descr'];
|
||||||
|
$rrd_list[$i]['ds'] = $ds;
|
||||||
|
$rrd_list[$i]['colour'] = $var['colour'];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "file missing: $rrd_filename";
|
||||||
|
}
|
||||||
|
|
||||||
|
require 'includes/graphs/generic_v3_multiline_float.inc.php';
|
||||||
35
html/includes/graphs/application/pi-hole_blocklist.inc.php
Normal file
35
html/includes/graphs/application/pi-hole_blocklist.inc.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require 'includes/graphs/common.inc.php';
|
||||||
|
|
||||||
|
$scale_min = 0;
|
||||||
|
$colours = 'mixed';
|
||||||
|
$unit_text = 'Stats';
|
||||||
|
$unitlen = 6;
|
||||||
|
$bigdescrlen = 25;
|
||||||
|
$smalldescrlen = 25;
|
||||||
|
$dostack = 0;
|
||||||
|
$printtotal = 0;
|
||||||
|
$addarea = 1;
|
||||||
|
$transparency = 33;
|
||||||
|
$rrd_filename = rrd_name($device['hostname'], array('app', $app['app_type'], $app['app_id']));
|
||||||
|
|
||||||
|
$array = array(
|
||||||
|
'domains_blocked' => array('descr' => 'Blocked domains','colour' => '000000',),
|
||||||
|
);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||||
|
foreach ($array as $ds => $var) {
|
||||||
|
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||||
|
$rrd_list[$i]['descr'] = $var['descr'];
|
||||||
|
$rrd_list[$i]['ds'] = $ds;
|
||||||
|
$rrd_list[$i]['colour'] = $var['colour'];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "file missing: $rrd_filename";
|
||||||
|
}
|
||||||
|
|
||||||
|
require 'includes/graphs/generic_v3_multiline_float.inc.php';
|
||||||
@@ -35,11 +35,6 @@ $transparency = 33;
|
|||||||
$rrd_filename = rrd_name($device['hostname'], array('app', $app['app_type'], $app['app_id']));
|
$rrd_filename = rrd_name($device['hostname'], array('app', $app['app_type'], $app['app_id']));
|
||||||
|
|
||||||
$array = array(
|
$array = array(
|
||||||
'domains_blocked' => array('descr' => 'Blocked domains','colour' => '000000',),
|
|
||||||
'dns_query' => array('descr' => 'Today DNS Queries','colour' => '657C5E',),
|
|
||||||
'ads_blocked' => array('descr' => 'ADs blocked','colour' => 'F44842',),
|
|
||||||
'ads_percentage' => array('descr' => 'ADs blocked %','colour' => '912925',),
|
|
||||||
'unique_domains' => array('descr' => 'Unique domains','colour' => 'F44842',),
|
|
||||||
'queries_forwarded' => array('descr' => 'Queries forwarded','colour' => '1F35A5',),
|
'queries_forwarded' => array('descr' => 'Queries forwarded','colour' => '1F35A5',),
|
||||||
'queries_cached' => array('descr' => 'Queries cached','colour' => '137C21',),
|
'queries_cached' => array('descr' => 'Queries cached','colour' => '137C21',),
|
||||||
);
|
);
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require 'includes/graphs/common.inc.php';
|
||||||
|
|
||||||
|
$scale_min = 0;
|
||||||
|
$colours = 'mixed';
|
||||||
|
$unit_text = 'Stats';
|
||||||
|
$unitlen = 6;
|
||||||
|
$bigdescrlen = 25;
|
||||||
|
$smalldescrlen = 25;
|
||||||
|
$dostack = 0;
|
||||||
|
$printtotal = 0;
|
||||||
|
$addarea = 1;
|
||||||
|
$transparency = 33;
|
||||||
|
$rrd_filename = rrd_name($device['hostname'], array('app', $app['app_type'], $app['app_id']));
|
||||||
|
|
||||||
|
$array = array(
|
||||||
|
'dns_query' => array('descr' => 'Today DNS Queries','colour' => '657C5E',),
|
||||||
|
'ads_blocked' => array('descr' => 'ADs blocked','colour' => 'F44842',),
|
||||||
|
);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
|
||||||
|
if (rrdtool_check_rrd_exists($rrd_filename)) {
|
||||||
|
foreach ($array as $ds => $var) {
|
||||||
|
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||||
|
$rrd_list[$i]['descr'] = $var['descr'];
|
||||||
|
$rrd_list[$i]['ds'] = $ds;
|
||||||
|
$rrd_list[$i]['colour'] = $var['colour'];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "file missing: $rrd_filename";
|
||||||
|
}
|
||||||
|
|
||||||
|
require 'includes/graphs/generic_v3_multiline_float.inc.php';
|
||||||
@@ -264,8 +264,11 @@ $graphs['sdfsinfo'] = array(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$graphs['pi-hole'] = array(
|
$graphs['pi-hole'] = array(
|
||||||
'stats',
|
'query_types',
|
||||||
'queries',
|
'destinations',
|
||||||
|
'query_results',
|
||||||
|
'block_percent',
|
||||||
|
'blocklist',
|
||||||
);
|
);
|
||||||
|
|
||||||
print_optionbar_start();
|
print_optionbar_start();
|
||||||
|
|||||||
@@ -16,8 +16,11 @@
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$graphs = array(
|
$graphs = array(
|
||||||
'pi-hole_stats' => 'Stats',
|
'pi-hole_query_types' => 'Query Types',
|
||||||
'pi-hole_queries' => 'Queries',
|
'pi-hole_destinations' => 'Destinations',
|
||||||
|
'pi-hole_query_results' => 'Query Results',
|
||||||
|
'pi-hole_block_percent' => 'Block Percentage',
|
||||||
|
'pi-hole_blocklist' => 'Blocklist Domains'
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($graphs as $key => $text) {
|
foreach ($graphs as $key => $text) {
|
||||||
|
|||||||
Reference in New Issue
Block a user