2010-02-09 16:36:06 +00:00
|
|
|
<?php
|
|
|
|
|
2011-04-21 10:37:23 +00:00
|
|
|
$datas = array('processor','mempool','storage');
|
|
|
|
if ($used_sensors['temperature']) $datas[] = 'temperature';
|
|
|
|
if ($used_sensors['humidity']) $datas[] = 'humidity';
|
|
|
|
if ($used_sensors['fanspeed']) $datas[] = 'fanspeed';
|
|
|
|
if ($used_sensors['voltage']) $datas[] = 'voltage';
|
|
|
|
if ($used_sensors['frequency']) $datas[] = 'frequency';
|
|
|
|
if ($used_sensors['current']) $datas[] = 'current';
|
|
|
|
if ($used_sensors['power']) $datas[] = 'power';
|
2011-04-09 14:22:43 +00:00
|
|
|
|
2011-04-21 13:01:51 +00:00
|
|
|
# FIXME generalize -> static-config ?
|
2011-04-09 14:22:43 +00:00
|
|
|
$type_text['overview'] = "Overview";
|
|
|
|
$type_text['temperature'] = "Temperature";
|
|
|
|
$type_text['humidity'] = "Humidity";
|
|
|
|
$type_text['mempool'] = "Memory";
|
|
|
|
$type_text['storage'] = "Disk Usage";
|
|
|
|
$type_text['diskio'] = "Disk I/O";
|
|
|
|
$type_text['processor'] = "Processor";
|
2011-04-13 14:12:57 +00:00
|
|
|
$type_text['voltage'] = "Voltage";
|
2011-04-09 14:22:43 +00:00
|
|
|
$type_text['fanspeed'] = "Fanspeed";
|
|
|
|
$type_text['frequency'] = "Frequency";
|
|
|
|
$type_text['current'] = "Current";
|
2011-04-20 09:59:48 +00:00
|
|
|
$type_text['power'] = "Power";
|
2010-04-11 13:45:19 +00:00
|
|
|
|
2011-04-11 09:16:50 +00:00
|
|
|
if (!$_GET['opta']) { $_GET['opta'] = "processor"; }
|
2011-03-17 00:09:20 +00:00
|
|
|
if (!$_GET['optb']) { $_GET['optb'] = "nographs"; }
|
2010-06-12 12:07:16 +00:00
|
|
|
|
|
|
|
print_optionbar_start('', '');
|
2010-02-11 01:48:55 +00:00
|
|
|
|
2011-04-29 23:09:35 +00:00
|
|
|
echo('<span style="font-weight: bold;">Health</span> » ');
|
|
|
|
|
2010-03-06 01:32:41 +00:00
|
|
|
$sep = "";
|
2011-03-17 00:09:20 +00:00
|
|
|
foreach ($datas as $texttype)
|
2010-06-18 14:17:58 +00:00
|
|
|
{
|
2010-02-11 01:48:55 +00:00
|
|
|
$type = strtolower($texttype);
|
|
|
|
echo($sep);
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($_GET['opta'] == $type)
|
|
|
|
{
|
2011-04-09 12:35:24 +00:00
|
|
|
echo("<span class='pagemenu-selected'>");
|
2011-03-17 00:09:20 +00:00
|
|
|
}
|
2011-04-09 14:22:43 +00:00
|
|
|
|
2011-04-15 17:22:35 +00:00
|
|
|
echo('<a href="health/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $type_text[$type] .'</a>');
|
2011-04-09 12:35:24 +00:00
|
|
|
|
2011-04-15 17:22:35 +00:00
|
|
|
if ($_GET['opta'] == $type) { echo("</span>"); }
|
2011-04-09 12:35:24 +00:00
|
|
|
|
2010-02-11 01:48:55 +00:00
|
|
|
$sep = ' | ';
|
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2010-02-11 01:48:55 +00:00
|
|
|
unset ($sep);
|
|
|
|
|
2010-06-12 12:07:16 +00:00
|
|
|
echo('<div style="float: right;">');
|
|
|
|
|
2011-03-17 00:09:20 +00:00
|
|
|
if ($_GET['optb'] == "graphs")
|
|
|
|
{
|
2011-04-09 12:35:24 +00:00
|
|
|
echo('<span class="pagemenu-selected">');
|
2010-06-12 14:18:56 +00:00
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2010-06-12 21:14:48 +00:00
|
|
|
echo('<a href="health/'. $_GET['opta'].'/graphs/"> Graphs</a>');
|
2011-03-17 00:09:20 +00:00
|
|
|
|
|
|
|
if ($_GET['optb'] == "graphs")
|
|
|
|
{
|
2011-04-09 12:35:24 +00:00
|
|
|
echo('</span>');
|
2011-03-17 00:09:20 +00:00
|
|
|
}
|
|
|
|
|
2010-06-12 12:07:16 +00:00
|
|
|
echo(' | ');
|
2011-03-17 00:09:20 +00:00
|
|
|
|
|
|
|
if ($_GET['optb'] == "nographs")
|
|
|
|
{
|
2011-04-09 12:35:24 +00:00
|
|
|
echo('<span class="pagemenu-selected">');
|
2010-06-12 14:18:56 +00:00
|
|
|
}
|
2011-03-17 00:09:20 +00:00
|
|
|
|
2010-06-12 21:14:48 +00:00
|
|
|
echo('<a href="health/'. $_GET['opta'].'/nographs/"> No Graphs</a>');
|
2010-02-11 01:48:55 +00:00
|
|
|
|
2011-04-09 12:35:24 +00:00
|
|
|
if ($_GET['optb'] == "nographs")
|
|
|
|
{
|
|
|
|
echo('</span>');
|
|
|
|
}
|
2010-02-11 01:48:55 +00:00
|
|
|
|
2010-06-12 12:07:16 +00:00
|
|
|
echo('</div>');
|
|
|
|
|
|
|
|
print_optionbar_end();
|
2010-02-11 01:48:55 +00:00
|
|
|
|
2011-04-21 13:01:51 +00:00
|
|
|
if (in_array($_GET['opta'],array_keys($used_sensors))
|
|
|
|
|| $_GET['opta'] == 'processor'
|
|
|
|
|| $_GET['opta'] == 'storage'
|
|
|
|
|| $_GET['opta'] == 'mempool')
|
2010-02-09 16:36:06 +00:00
|
|
|
{
|
2011-04-21 13:01:51 +00:00
|
|
|
include('pages/health/'.$_GET['opta'].'.inc.php');
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
echo("No sensors of type " . $_GET['opta'] . " found.");
|
2010-02-09 16:36:06 +00:00
|
|
|
}
|
|
|
|
|
2011-04-09 12:35:24 +00:00
|
|
|
?>
|