mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
webui: Added toner support in health metrics list (#7595)
This commit is contained in:
@@ -425,7 +425,16 @@ foreach (array_keys($menu_sensors) as $item) {
|
||||
$sep++;
|
||||
}
|
||||
|
||||
|
||||
$toner = new ObjectCache('toner');
|
||||
if ($toner) {
|
||||
echo '<li role="presentation" class="divider"></li>';
|
||||
echo '<li><a href="health/metric=toner/"><i class="fa fa-print fa-fw fa-lg"></i> Toner</a></li>';
|
||||
$used_sensors['toner'] = $toner;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
|
@@ -49,6 +49,9 @@ if ($used_sensors['pressure']) {
|
||||
if ($used_sensors['cooling']) {
|
||||
$datas[] = 'cooling';
|
||||
}
|
||||
if ($used_sensors['toner']) {
|
||||
$datas[] = 'toner';
|
||||
}
|
||||
|
||||
// FIXME generalize -> static-config ?
|
||||
$type_text['overview'] = "Overview";
|
||||
@@ -73,6 +76,7 @@ $type_text['signal'] = "Signal";
|
||||
$type_text['snr'] = "SNR";
|
||||
$type_text['pressure'] = "Pressure";
|
||||
$type_text['cooling'] = "Cooling";
|
||||
$type_text['toner'] = 'Toner';
|
||||
|
||||
if (!$vars['metric']) {
|
||||
$vars['metric'] = "processor";
|
||||
|
10
includes/caches/toner.inc.php
Normal file
10
includes/caches/toner.inc.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
if (is_admin() || is_read()) {
|
||||
$data['count'] = array('query' => "SELECT COUNT(`toner_id`) FROM toner");
|
||||
} else {
|
||||
$data['count'] = array(
|
||||
'query' => "SELECT COUNT(`toner_id`) FROM toner AS T, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND T.`device_id` = D.`device_id`",
|
||||
'params' => array($_SESSION['user_id']),
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user