Tidy top 10 displays

This commit is contained in:
Paul Gear
2013-11-26 15:32:53 +10:00
parent 8d63a2d368
commit ab23cbe144
4 changed files with 35 additions and 25 deletions

View File

@@ -499,11 +499,33 @@ a.list-device-disabled, a.list-device-disabled:visited {
}
.boxes {
width: 350px;
height: 200px;
vertical-align: center;
}
.box {
width: 350px;
height: 300px;
padding: 0px;
vertical-align: center;
}
.top10 {
padding: 0px;
margin: 0px;
}
.welcome {
padding-right: 25px;
}
table.simple {
border: 0px;
padding: 0px;
margin: 0px;
width: 100%;
text-align: left;
}
.left-2-col-fluid {
display: table-cell;
margin-right: 400px;
@@ -1560,16 +1582,3 @@ tr.search:nth-child(odd) {
margin: 2px;
}
.box {
}
.welcome {
padding-right: 25px;
}
.simple {
border: 0px;
width: 100%;
text-align: left;
}

View File

@@ -31,10 +31,10 @@ $query = "
echo("<strong>Top $top devices (last $minutes minutes)</strong>\n");
echo("<table class='simple'>\n");
foreach (dbFetchRows($query) as $result) {
echo("<tr>".
"<td>".generate_device_link($result, shorthost($result['hostname']))."</td>".
"<td>".generate_device_link($result,
generate_minigraph_image($result, $config['time']['day'], $config['time']['now'], "device_bits", "no", 150, 21, '&'), array(), 0, 0, 0)."</td>".
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");

View File

@@ -29,10 +29,11 @@ $query = "
echo("<strong>Top $top ports (last $minutes minutes)</strong>\n");
echo("<table class='simple'>\n");
foreach (dbFetchRows($query) as $result) {
echo("<tr><td>".
generate_device_link($result, shorthost($result['hostname'])).
"</td><td>".generate_port_link($result).
"</td><td>".generate_port_link($result, generate_port_thumbnail($result))."</td></tr>\n");
echo("<tr class=top10>".
"<td class=top10>".generate_device_link($result, shorthost($result['hostname']))."</td>".
"<td class=top10>".generate_port_link($result)."</td>".
"<td class=top10>".generate_port_link($result, generate_port_thumbnail($result))."</td>".
"</tr>\n");
}
echo("</table>\n");

View File

@@ -113,9 +113,9 @@ function get_percentage_colours($percentage)
}
function generate_minigraph_image($device, $start, $end, $type, $legend = 'no', $width = 275, $height = 100, $sep = '&amp;')
function generate_minigraph_image($device, $start, $end, $type, $legend = 'no', $width = 275, $height = 100, $sep = '&amp;', $class = "minigraph-image")
{
return '<img class=minigraph-image src="graph.php?'.
return '<img class="'.$class.'" src="graph.php?'.
implode(array('device='.$device['device_id'], "from=$start", "to=$end", "width=$width", "height=$height", "type=$type", "legend=$legend"), $sep).'">';
}