commit version 22.12.12447

This commit is contained in:
2023-01-01 22:36:12 -05:00
parent af1b03d79f
commit b948283a96
744 changed files with 620715 additions and 27381 deletions

View File

@ -6,31 +6,55 @@
*
* @package observium
* @subpackage graphs
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
/// FIXME. To unify all sensor graphs.
$include = $config['html_dir'] . "/includes/graphs/$type/";
// Some Class specific options
switch ($sensor['sensor_class']) {
case 'humidity':
case 'capacity':
case 'load':
case 'progress':
include($include."percent.inc.php");
$scale_min = "0";
$scale_max = "100";
break;
case 'snr':
case 'attenuation':
case 'sound':
include($include."db.inc.php");
$scale_min = "0";
$scale_max = "60";
break;
default:
if (is_file($include.$sensor['sensor_class'].".inc.php")) {
include($include.$sensor['sensor_class'].".inc.php");
} else {
graph_error($type.'_'.$subtype); // Graph Template Missing;
}
}
unset($include);
$ds = "sensor";
$sensor_type = $config['sensor_types'][$sensor['sensor_type']];
$line_text = $sensor['sensor_descr'];
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
if (isset($sensor_type['graph_unit'])) {
$unit_text = $sensor_type['graph_unit'];
} else {
$unit_text = $sensor_type['symbol'];
}
$print_min = 1;
include($config['html_dir']."/includes/graphs/generic_simplex.inc.php");
if (is_numeric($sensor['sensor_limit'])) {
$rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
}
if (is_numeric($sensor['sensor_limit_low'])) {
$rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
}
$graph_return['descr'] = $sensor_type['descr'];
// EOF