mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 16:26:55 +02:00
add graphs/nographs option to global health pages
git-svn-id: http://www.observium.org/svn/observer/trunk@1147 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -53,6 +53,35 @@ while($current = mysql_fetch_array($query))
|
||||
<td>" . (isset($current['current_notes']) ? $current['current_notes'] : '') . "</td>
|
||||
</tr>\n");
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=7>");
|
||||
|
||||
$daily_graph = "graph.php?id=" . $current['current_id'] . "&type=current&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $current['current_id'] . "&type=current&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $current['current_id'] . "&type=current&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $current['current_id'] . "&type=current&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $current['current_id'] . "&type=current&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $current['current_id'] . "&type=current&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $current['current_id'] . "&type=current&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $current['current_id'] . "&type=current&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,36 @@ while($fan = mysql_fetch_array($query))
|
||||
<td>" . (isset($fan['fan_notes']) ? $fan['fan_notes'] : '') . "</td>
|
||||
</tr>\n");
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=6>");
|
||||
|
||||
$daily_graph = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $fan['fan_id'] . "&type=fanspeed&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,34 @@ while($freq = mysql_fetch_array($query))
|
||||
<td>" . (isset($freq['freq_notes']) ? $freq['freq_notes'] : '') . "</td>
|
||||
</tr>\n");
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=6>");
|
||||
|
||||
$daily_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</a></td>
|
||||
<td width=50>".$perc."%</td>
|
||||
</tr>");
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
".print_percentage_bar (400, 20, $perc, $perc."%", "ffffff", $left_background, (100 - $perc)."%" , "ffffff", $right_background).'</a></td>
|
||||
</tr>');
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs are requested, do them, else not!
|
||||
|
||||
echo(' <tr bgcolor="'.$row_colour.'"><td colspan="5">');
|
||||
|
||||
$daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$day&to=$now&width=211&height=100";
|
||||
@@ -66,6 +68,8 @@
|
||||
echo(" </td>
|
||||
</tr>");
|
||||
|
||||
} #end graphs if
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,36 @@ while($drive = mysql_fetch_array($query)) {
|
||||
</td><td>$perc"."%</td></tr>");
|
||||
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
$daily_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,36 @@ while($temp = mysql_fetch_array($query))
|
||||
<td>" . (isset($temp['temp_notes']) ? $temp['temp_notes'] : '') . "</td>
|
||||
</tr>\n");
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=7>");
|
||||
|
||||
$daily_graph = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $temp['temp_id'] . "&type=temperature&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,37 @@ while($volt = mysql_fetch_array($query))
|
||||
<td>" . (isset($volt['volt_notes']) ? $volt['volt_notes'] : '') . "</td>
|
||||
</tr>\n");
|
||||
|
||||
if($_GET['optb'] == "graphs") { ## If graphs
|
||||
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=7>");
|
||||
|
||||
$daily_graph = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$day&to=$now&width=211&height=100";
|
||||
$daily_url = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$day&to=$now&width=400&height=150";
|
||||
|
||||
$weekly_graph = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$week&to=$now&width=211&height=100";
|
||||
$weekly_url = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$week&to=$now&width=400&height=150";
|
||||
|
||||
$monthly_graph = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$month&to=$now&width=211&height=100";
|
||||
$monthly_url = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$month&to=$now&width=400&height=150";
|
||||
|
||||
$yearly_graph = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$year&to=$now&width=211&height=100";
|
||||
$yearly_url = "graph.php?id=" . $volt['volt_id'] . "&type=voltage&from=$year&to=$now&width=400&height=150";
|
||||
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_graph' border=0></a> ");
|
||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_graph' border=0></a>");
|
||||
echo("</td></tr>");
|
||||
|
||||
} # endif graphs
|
||||
|
||||
|
||||
|
||||
|
||||
$row++;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user