mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix coding style part 2
This commit is contained in:
@@ -14,9 +14,9 @@
|
||||
*/
|
||||
|
||||
$minutes = 15;
|
||||
$seconds = $minutes * 60;
|
||||
$top = $config['front_page_settings']['top']['devices'];
|
||||
if (is_admin() === TRUE || is_read() === TRUE) {
|
||||
$seconds = ($minutes * 60);
|
||||
$top = $config['front_page_settings']['top']['devices'];
|
||||
if (is_admin() === true || is_read() === true) {
|
||||
$query = "
|
||||
SELECT *, sum(p.ifInOctets_rate + p.ifOutOctets_rate) as total
|
||||
FROM ports as p, devices as d
|
||||
@@ -27,9 +27,10 @@ if (is_admin() === TRUE || is_read() === TRUE) {
|
||||
GROUP BY d.device_id
|
||||
ORDER BY total desc
|
||||
LIMIT $top
|
||||
";
|
||||
} else {
|
||||
$query = "
|
||||
";
|
||||
}
|
||||
else {
|
||||
$query = "
|
||||
SELECT *, sum(p.ifInOctets_rate + p.ifOutOctets_rate) as total
|
||||
FROM ports as p, devices as d, `devices_perms` AS `P`
|
||||
WHERE `P`.`user_id` = ? AND `P`.`device_id` = `d`.`device_id` AND
|
||||
@@ -40,19 +41,21 @@ if (is_admin() === TRUE || is_read() === TRUE) {
|
||||
GROUP BY d.device_id
|
||||
ORDER BY total desc
|
||||
LIMIT $top
|
||||
";
|
||||
";
|
||||
$param[] = array($_SESSION['user_id']);
|
||||
}//end if
|
||||
|
||||
echo "<strong>Top $top devices (last $minutes minutes)</strong>\n";
|
||||
echo "<table class='simple'>\n";
|
||||
foreach (dbFetchRows($query, $param) as $result) {
|
||||
echo '<tr class=top10>'.'<td class=top10>'.generate_device_link($result, shorthost($result['hostname'])).'</td>'.'<td class=top10>'.generate_device_link(
|
||||
$result,
|
||||
generate_minigraph_image($result, $config['time']['day'], $config['time']['now'], 'device_bits', 'no', 150, 21, '&', 'top10'),
|
||||
array(),
|
||||
0,
|
||||
0,
|
||||
0
|
||||
).'</td>'."</tr>\n";
|
||||
}
|
||||
|
||||
echo("<strong>Top $top devices (last $minutes minutes)</strong>\n");
|
||||
echo("<table class='simple'>\n");
|
||||
foreach (dbFetchRows($query,$param) as $result) {
|
||||
echo("<tr class=top10>".
|
||||
"<td class=top10>".generate_device_link($result, shorthost($result['hostname']))."</td>".
|
||||
"<td class=top10>".generate_device_link($result,
|
||||
generate_minigraph_image($result, $config['time']['day'], $config['time']['now'], "device_bits", "no", 150, 21, '&', "top10"), array(), 0, 0, 0)."</td>".
|
||||
"</tr>\n");
|
||||
}
|
||||
echo("</table>\n");
|
||||
|
||||
?>
|
||||
echo "</table>\n";
|
||||
|
Reference in New Issue
Block a user