added missing pages for current and frequencies on the devices health tab

git-svn-id: http://www.observium.org/svn/observer/trunk@1202 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-06-18 14:17:58 +00:00
parent ccda0e3966
commit 98fd758f8e
4 changed files with 128 additions and 6 deletions

View File

@@ -39,13 +39,14 @@ foreach ($datas as $type) {
echo($sep);
if ($_GET['opta'] == $type) {
if ($_GET['opta'] == $type)
{
echo("<strong>");
echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
} else {
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
}
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/health/" . $type . "/" . $_GET['optb']. "/'> " . $type_text[$type] ."</a>\n");
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/health/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type_text[$type] ."</a>\n");
if ($_GET['opta'] == $type) { echo("</strong>"); }
$sep = " | ";
}

View File

@@ -0,0 +1,59 @@
<?php
$sql = "SELECT * FROM `current` WHERE device_id = '" . $_GET[id] . "' ORDER BY current_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
$row = 1;
while($current = mysql_fetch_array($query)) {
if(!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
<td width=350>" . $current['current_descr'] . "</td>
<td>" . $current['current_current'] . "A</td>
<td>" . $current['current_limit_low'] . 'A - ' . $current['current_limit'] . "A</td>
<td>" . $current['current_notes'] . "</td>
</tr>\n");
echo("<tr bgcolor=$row_colour><td colspan='4'>");
$graph_type = "current";
// start current graphs
$daily_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$day&to=$now&width=211&height=100";
$daily_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
$weekly_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$week&to=$now&width=211&height=100";
$weekly_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$week&to=$now&width=400&height=150";
$monthly_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$month&to=$now&width=211&height=100";
$monthly_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$month&to=$now&width=400&height=150";
$yearly_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$year&to=$now&width=211&height=100";
$yearly_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$year&to=$now&width=400&height=150";
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$daily_current' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$weekly_current' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$monthly_current' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$yearly_current' border=0></a>");
echo("</td></tr>");
$row++;
}
echo("</table>");
?>

View File

@@ -0,0 +1,58 @@
<?php
$sql = "SELECT * FROM `frequency` WHERE device_id = '" . $_GET[id] . "' ORDER BY freq_descr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=5 width=100%>");
$row = 1;
while($freq = mysql_fetch_array($query)) {
if(!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
<td width=350>" . $freq['freq_descr'] . "</td>
<td>" . $freq['freq_current'] . "Hz</td>
<td>" . $freq['freq_limit_low'] . 'Hz - ' . $freq['freq_limit'] . "Hz</td>
<td>" . $freq['freq_notes'] . "</td>
</tr>\n");
echo("<tr bgcolor=$row_colour><td colspan='4'>");
$graph_type = "frequency";
// start frequency graphs
$daily_freq = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$day&to=$now&width=211&height=100";
$daily_url = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
$weekly_freq = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$week&to=$now&width=211&height=100";
$weekly_url = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$week&to=$now&width=400&height=150";
$monthly_freq = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$month&to=$now&width=211&height=100";
$monthly_url = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$month&to=$now&width=400&height=150";
$yearly_freq = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$year&to=$now&width=211&height=100";
$yearly_url = "graph.php?id=" . $freq['freq_id'] . "&type=$graph_type&from=$year&to=$now&width=400&height=150";
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$daily_freq' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$weekly_freq' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$monthly_freq' border=0></a> ");
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
<img src='$yearly_freq' border=0></a>");
echo("</td></tr>");
$row++;
}
echo("</table>");
?>

View File

@@ -9,16 +9,20 @@ if(!$_GET['optb']) { $_GET['optb'] = "nographs"; }
print_optionbar_start('', '');
$sep = "";
foreach ($datas as $texttype) {
foreach ($datas as $texttype)
{
$type = strtolower($texttype);
echo($sep);
if ($_GET['opta'] == $type) {
if ($_GET['opta'] == $type)
{
echo("<strong>");
echo('<img src="images/icons/'.$type.'.png" class="optionicon" />');
} else {
}
else
{
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
}
echo("<a href='".$config['base_url']."/health/" . $type . "/" . $_GET['optb']. "/'> " . $texttype ."</a>\n");
echo('<a href="'.$config['base_url'].'/health/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/"> ' . $texttype ."</a>\n");
if ($_GET['opta'] == $type) { echo("</strong>"); }
$sep = ' | ';
}