2010-02-25 01:28:25 +00:00
|
|
|
<?php
|
2010-07-24 19:14:41 +00:00
|
|
|
|
|
|
|
$graph_type = "mempool_usage";
|
2011-03-16 23:10:10 +00:00
|
|
|
|
|
|
|
echo("<div style='margin-top: 5px; padding: 0px;'>");
|
|
|
|
echo("<table width=100% cellpadding=6 cellspacing=0>");
|
|
|
|
|
|
|
|
$i = '1';
|
|
|
|
|
2012-05-06 18:38:11 +00:00
|
|
|
#FIXME css alternating colours
|
|
|
|
|
2011-05-16 11:01:48 +00:00
|
|
|
foreach (dbFetchRows("SELECT * FROM `mempools` WHERE device_id = ?", array($device['device_id'])) as $mempool)
|
2011-03-16 23:10:10 +00:00
|
|
|
{
|
|
|
|
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
|
|
|
|
2015-01-22 21:22:37 +00:00
|
|
|
if ($config['memcached']['enable'] === TRUE)
|
2012-05-25 18:35:17 +00:00
|
|
|
{
|
|
|
|
$state = $memcache->get('mempool-'.$mempool['mempool_id'].'-state');
|
|
|
|
if($debug) { print_r($state); }
|
|
|
|
if(is_array($state)) { $mempool = array_merge($mempool, $state); }
|
|
|
|
unset($state);
|
|
|
|
}
|
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$text_descr = rewrite_entity_descr($mempool['mempool_descr']);
|
|
|
|
|
2014-07-07 00:50:16 +01:00
|
|
|
$mempool_url = "graphs/id=".$mempool['mempool_id']."/type=mempool_usage/";
|
2012-05-06 18:38:11 +00:00
|
|
|
$mini_url = "graph.php?id=".$mempool['mempool_id']."&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=80&height=20&bg=f4f4f4";
|
2011-03-16 23:10:10 +00:00
|
|
|
|
|
|
|
$mempool_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$text_descr;
|
2012-05-06 18:38:11 +00:00
|
|
|
$mempool_popup .= "</div><img src=\'graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=400&height=125\'>";
|
2011-03-16 23:10:10 +00:00
|
|
|
$mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
|
|
|
|
|
|
|
$total = formatStorage($mempool['mempool_total']);
|
|
|
|
$used = formatStorage($mempool['mempool_used']);
|
|
|
|
$free = formatStorage($mempool['mempool_free']);
|
|
|
|
|
|
|
|
$perc = round($mempool['mempool_used'] / $mempool['mempool_total'] * 100);
|
|
|
|
|
2011-04-25 17:15:36 +00:00
|
|
|
$background = get_percentage_colours($percent);
|
|
|
|
$right_background = $background['right'];
|
|
|
|
$left_background = $background['left'];
|
2011-03-16 23:10:10 +00:00
|
|
|
|
|
|
|
echo("<tr bgcolor=$row_colour><td class=tablehead><a href='".$mempool_url."' $mempool_popup>" . $text_descr . "</a></td>
|
2010-02-25 01:28:25 +00:00
|
|
|
<td width=90><a href='".$mempool_url."' $mempool_popup><img src='$mini_url'></a></td>
|
|
|
|
<td width=200><a href='".$mempool_url."' $mempool_popup>
|
|
|
|
".print_percentage_bar (400, 20, $perc, "$used / $total", "ffffff", $left_background, $free , "ffffff", $right_background)."
|
|
|
|
</a></td>
|
|
|
|
<td width=50>".$perc."%</td>
|
|
|
|
</tr>");
|
|
|
|
|
|
|
|
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
2010-07-25 14:21:05 +00:00
|
|
|
|
|
|
|
$graph_array['id'] = $mempool['mempool_id'];
|
|
|
|
$graph_array['type'] = $graph_type;
|
|
|
|
|
2012-04-26 16:49:38 +00:00
|
|
|
include("includes/print-graphrow.inc.php");
|
2010-07-25 14:21:05 +00:00
|
|
|
|
2010-02-25 01:28:25 +00:00
|
|
|
echo("</td></tr>");
|
|
|
|
|
2011-03-16 23:10:10 +00:00
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo("</table>");
|
|
|
|
echo("</div>");
|
|
|
|
|
2011-04-25 17:15:36 +00:00
|
|
|
?>
|