mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
more icons and fixing overview.
git-svn-id: http://www.observium.org/svn/observer/trunk@1009 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,5 +1,24 @@
|
||||
<?php
|
||||
|
||||
function print_graph_tag ($args)
|
||||
{
|
||||
echo generate_graph_tag ($args);
|
||||
}
|
||||
|
||||
function generate_graph_tag ($args)
|
||||
{
|
||||
global $config;
|
||||
$sep = "?";
|
||||
$url = $config['base_url'] . "/graph.php";
|
||||
foreach ($args as $key => $arg)
|
||||
{
|
||||
$url .= $sep.$key."=".$arg;
|
||||
$sep="&";
|
||||
}
|
||||
return "<img src=\"".$url."\" border=0>";
|
||||
}
|
||||
|
||||
|
||||
function print_percentage_bar ($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background)
|
||||
{
|
||||
$output = '
|
||||
@@ -32,14 +51,16 @@ function generate_if_link($args)
|
||||
return $link;
|
||||
}
|
||||
|
||||
function generate_port_thumbnail($args) {
|
||||
function generate_port_thumbnail($args)
|
||||
{
|
||||
if(!$args['bg']) { $args['bg'] = "FFFFF"; }
|
||||
$args['content'] = "<img src='graph.php?type=".$args['graph_type']."&if=".$args['interface_id']."&from=".$args['from']."&to=".$args['to']."&width=".$args['width']."&height=".$args['height']."&legend=no&bg=".$args['bg']."'>";
|
||||
$output = generate_if_link($args);
|
||||
echo $output;
|
||||
}
|
||||
|
||||
function print_optionbar_start ($height = 20, $width = 0) {
|
||||
function print_optionbar_start ($height = 20, $width = 0)
|
||||
{
|
||||
echo("
|
||||
<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 10px; " . ($width ? 'max-width: ' . $width . 'px; ' : '') . "'>
|
||||
<b class='rounded'>
|
||||
@@ -53,7 +74,8 @@ function print_optionbar_start ($height = 20, $width = 0) {
|
||||
}
|
||||
|
||||
|
||||
function print_optionbar_end () {
|
||||
function print_optionbar_end ()
|
||||
{
|
||||
echo(" </div>
|
||||
</div>
|
||||
<b class='rounded'>
|
||||
|
||||
@@ -6,25 +6,43 @@
|
||||
|
||||
if(!$device) { $device['device_id'] = getifhost($interface['interface_id']); }
|
||||
|
||||
$daily_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
|
||||
$daily_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
|
||||
|
||||
# $daily_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
|
||||
# $daily_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150";
|
||||
|
||||
$weekly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=215&height=100";
|
||||
$weekly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150";
|
||||
# $weekly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=215&height=100";
|
||||
# $weekly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150";
|
||||
|
||||
$monthly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=215&height=100";
|
||||
$monthly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150";
|
||||
# $monthly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=215&height=100";
|
||||
# $monthly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150";
|
||||
|
||||
$yearly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=215&height=100";
|
||||
$yearly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
|
||||
# $yearly_traffic = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=215&height=100";
|
||||
# $yearly_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
|
||||
|
||||
echo("<a href='".$daily_url."' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$daily_traffic' border=0></a> ");
|
||||
echo("<a href='".$weekly_url."' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
<img src='$weekly_traffic' border=0></a> ");
|
||||
echo("<a href='".$monthly_url."' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$monthly_traffic' border=0></a> ");
|
||||
echo("<a href='".$yearly_url."' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
<img src='$yearly_traffic' border=0></a>");
|
||||
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['port'] = $interface['interface_id'];
|
||||
$graph_array['type'] = $graph_type;
|
||||
|
||||
$graph_array['from'] = $day;
|
||||
print_graph_tag($graph_array);
|
||||
$graph_array['from'] = $week;
|
||||
print_graph_tag($graph_array);
|
||||
$graph_array['from'] = $month;
|
||||
print_graph_tag($graph_array);
|
||||
$graph_array['from'] = $year;
|
||||
print_graph_tag($graph_array);
|
||||
|
||||
|
||||
# echo("<a href='".$daily_url."' onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
# <img src='$daily_traffic' border=0></a> ");
|
||||
# echo("<a href='".$weekly_url."' onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||
# <img src='$weekly_traffic' border=0></a> ");
|
||||
# echo("<a href='".$monthly_url."' onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
# <img src='$monthly_traffic' border=0></a> ");
|
||||
# echo("<a href='".$yearly_url."' onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\">
|
||||
# <img src='$yearly_traffic' border=0></a>");
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user