mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 00:11:49 +02:00
Tidy top 10 displays
This commit is contained in:
+24
-15
@@ -499,11 +499,33 @@ a.list-device-disabled, a.list-device-disabled:visited {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.boxes {
|
.boxes {
|
||||||
width: 350px;
|
|
||||||
height: 200px;
|
|
||||||
vertical-align: center;
|
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 {
|
.left-2-col-fluid {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
margin-right: 400px;
|
margin-right: 400px;
|
||||||
@@ -1560,16 +1582,3 @@ tr.search:nth-child(odd) {
|
|||||||
margin: 2px;
|
margin: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
|
||||||
}
|
|
||||||
|
|
||||||
.welcome {
|
|
||||||
padding-right: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.simple {
|
|
||||||
border: 0px;
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ $query = "
|
|||||||
echo("<strong>Top $top devices (last $minutes minutes)</strong>\n");
|
echo("<strong>Top $top devices (last $minutes minutes)</strong>\n");
|
||||||
echo("<table class='simple'>\n");
|
echo("<table class='simple'>\n");
|
||||||
foreach (dbFetchRows($query) as $result) {
|
foreach (dbFetchRows($query) as $result) {
|
||||||
echo("<tr>".
|
echo("<tr class=top10>".
|
||||||
"<td>".generate_device_link($result, shorthost($result['hostname']))."</td>".
|
"<td class=top10>".generate_device_link($result, shorthost($result['hostname']))."</td>".
|
||||||
"<td>".generate_device_link($result,
|
"<td class=top10>".generate_device_link($result,
|
||||||
generate_minigraph_image($result, $config['time']['day'], $config['time']['now'], "device_bits", "no", 150, 21, '&'), array(), 0, 0, 0)."</td>".
|
generate_minigraph_image($result, $config['time']['day'], $config['time']['now'], "device_bits", "no", 150, 21, '&', "top10"), array(), 0, 0, 0)."</td>".
|
||||||
"</tr>\n");
|
"</tr>\n");
|
||||||
}
|
}
|
||||||
echo("</table>\n");
|
echo("</table>\n");
|
||||||
|
|||||||
@@ -29,10 +29,11 @@ $query = "
|
|||||||
echo("<strong>Top $top ports (last $minutes minutes)</strong>\n");
|
echo("<strong>Top $top ports (last $minutes minutes)</strong>\n");
|
||||||
echo("<table class='simple'>\n");
|
echo("<table class='simple'>\n");
|
||||||
foreach (dbFetchRows($query) as $result) {
|
foreach (dbFetchRows($query) as $result) {
|
||||||
echo("<tr><td>".
|
echo("<tr class=top10>".
|
||||||
generate_device_link($result, shorthost($result['hostname'])).
|
"<td class=top10>".generate_device_link($result, shorthost($result['hostname']))."</td>".
|
||||||
"</td><td>".generate_port_link($result).
|
"<td class=top10>".generate_port_link($result)."</td>".
|
||||||
"</td><td>".generate_port_link($result, generate_port_thumbnail($result))."</td></tr>\n");
|
"<td class=top10>".generate_port_link($result, generate_port_thumbnail($result))."</td>".
|
||||||
|
"</tr>\n");
|
||||||
}
|
}
|
||||||
echo("</table>\n");
|
echo("</table>\n");
|
||||||
|
|
||||||
|
|||||||
@@ -113,9 +113,9 @@ function get_percentage_colours($percentage)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate_minigraph_image($device, $start, $end, $type, $legend = 'no', $width = 275, $height = 100, $sep = '&')
|
function generate_minigraph_image($device, $start, $end, $type, $legend = 'no', $width = 275, $height = 100, $sep = '&', $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).'">';
|
implode(array('device='.$device['device_id'], "from=$start", "to=$end", "width=$width", "height=$height", "type=$type", "legend=$legend"), $sep).'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user