html fixes

git-svn-id: http://www.observium.org/svn/observer/trunk@658 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-01-10 18:19:15 +00:00
parent d6cff48859
commit 7c62b0a142
5 changed files with 48 additions and 47 deletions

View File

@@ -483,9 +483,8 @@ p.vspace { padding-top: 3px; padding-bottom: 3px; }
#content { margin: 0px; text-align: left; padding: 0px; } #content { margin: 0px; text-align: left; padding: 0px; }
#footer { #footer {
text-align: center;
width: 100%; height: 40px; width: 100%; height: 40px;
border: 1px none #ccc;
margin: 0px 0px 0px 0px; padding: 0px 0px 8px 0px;
} }
#copyright { margin: 0px 12px 0px 11px; padding: 2px 0px; border-top: 1px solid #ddd; font-size: 8pt; } #copyright { margin: 0px 12px 0px 11px; padding: 2px 0px; border-top: 1px solid #ddd; font-size: 8pt; }

View File

@@ -42,46 +42,48 @@ $services['disabled'] = mysql_result(mysql_query("SELECT count(service_id) FROM
} }
if($devices['down']) { $devices['bgcolour'] = "#ffcccc"; } else { $devices['bgcolour'] = ""; } if($devices['down']) { $devices['bgcolour'] = "#ffcccc"; } else { $devices['bgcolour'] = "transparent"; }
if($interfaces['down']) { $interfaces['bgcolour'] = "#ffcccc"; } else { $interfaces['bgcolour'] = "#e5e5e5"; } if($interfaces['down']) { $interfaces['bgcolour'] = "#ffcccc"; } else { $interfaces['bgcolour'] = "#e5e5e5"; }
if($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['bgcolour'] = ""; } if($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['bgcolour'] = "transparent"; }
?> ?>
<table cellpadding="2" cellspacing="0" border="0"> <table cellpadding="2" cellspacing="0" border="0">
<tr bgcolor="<?php echo $devices[bgcolour] ?>"><td width="5"></td> <tr style="background-color: <?php echo $devices[bgcolour] ?>">
<td>Devices : <td width="5"></td>
</td><td><?php echo $devices['count'] ?> <td>Devices : </td>
</td><td> ( <td><?php echo $devices['count'] ?></td>
</td><td style='text-align: right'><span class=green> <?php echo $devices['up'] ?> up</span> <td> ( </td>
</td><td style='text-align: right'><span class="red"> <?php echo $devices['down'] ?> down</span> <td style='text-align: right'><span class=green> <?php echo $devices['up'] ?> up</span></td>
</td><td style='text-align: right'><span class="black"> <?php echo $devices['ignored'] ?> ignored</span> <td style='text-align: right'><span class="red"> <?php echo $devices['down'] ?> down</span></td>
</td><td style='text-align: right'><span class="grey"> <?php echo $devices['disabled'] ?> disabled</span> <td style='text-align: right'><span class="black"> <?php echo $devices['ignored'] ?> ignored</span> </td>
</td><td> ) <td style='text-align: right'><span class="grey"> <?php echo $devices['disabled'] ?> disabled</span></td>
</td><td width=5></td> <td> ) </td>
</tr><tr bgcolor="<?php echo $interfaces['bgcolour'] ?>"> <td width=5></td>
<td width="5"></td><td>Interfaces : </tr>
</td><td><?php echo $interfaces['count'] ?> <tr style="background-color: <?php echo $interfaces['bgcolour'] ?>">
</td><td> ( <td width="5"></td><td>Interfaces : </td>
</td><td style='text-align: right'><span class=green> <?php echo $interfaces['up'] ?> up </span> <td><?php echo $interfaces['count'] ?></td>
</td><td style='text-align: right'><span class="red"> <?php echo $interfaces['down'] ?> down </span> <td> ( </td>
</td><td style='text-align: right'><span class="black"> <?php echo $interfaces['ignored'] ?> ignored </span> <td style='text-align: right'><span class=green> <?php echo $interfaces['up'] ?> up </span></td>
</td><td style='text-align: right'><span class="grey"> <?php echo $interfaces['shutdown'] ?> shutdown</span> <td style='text-align: right'><span class="red"> <?php echo $interfaces['down'] ?> down </span></td>
</td><td> ) <td style='text-align: right'><span class="black"> <?php echo $interfaces['ignored'] ?> ignored </span></td>
</td><td width=5></td> <td style='text-align: right'><span class="grey"> <?php echo $interfaces['shutdown'] ?> shutdown</span></td>
</tr><tr bgcolor="<?php echo $services['bgcolour'] ?>"> <td> ) </td>
<td width="5"></td><td>Services : <td width=5></td>
</td><td><?php echo $services['count'] ?> </tr>
</td><td> ( <tr style="background-color: <?php echo $services['bgcolour'] ?>">
</td><td style='text-align: right'><span class=green><?php echo $services['up'] ?> up</span> <td width="5"></td>
</td><td style='text-align: right'><span class="red"> <?php echo $services['down'] ?> down</span> <td>Services : </td>
</td><td style='text-align: right'><span class="black"> <?php echo $services['ignored'] ?> ignored</span> <td><?php echo $services['count'] ?></td>
</td><td style='text-align: right'><span class="grey"> <?php echo $services['disabled'] ?> disabled</span> <td> ( </td>
</td><td> ) <td style='text-align: right'><span class=green><?php echo $services['up'] ?> up</span></td>
</td><td width="5"></td> <td style='text-align: right'><span class="red"> <?php echo $services['down'] ?> down</span></td>
</tr> <td style='text-align: right'><span class="black"> <?php echo $services['ignored'] ?> ignored</span> </td>
</td> <td style='text-align: right'><span class="grey"> <?php echo $services['disabled'] ?> disabled</span></td>
<td> ) </td>
<td width="5"></td>
</tr> </tr>
<tr> <tr>
</table> </table>

View File

@@ -141,9 +141,9 @@ function popUp(URL) {
<?php <?php
$end = utime(); $run = $end - $start; $end = utime(); $run = $end - $start;
$gentime = substr($run, 0, 5); $gentime = substr($run, 0, 5);
echo('<br /> <center>Generated in ' . $gentime . ' seconds echo('<br /> <div id="footer">Generated in ' . $gentime . ' seconds
<br /> <a href="http://www.observernms.org">Observer ' . $config['version'] . '</a> &copy; 2006-2010 Adam Armstrong <br /> <a href="http://www.observernms.org">Observer ' . $config['version'] . '</a> &copy; 2006-2010 Adam Armstrong
<br />This work is licensed under the <a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">GPL, version 3</a>.'); <br />This work is licensed under the <a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">GPL, version 3</a>.</div>');
?> ?>

View File

@@ -48,7 +48,7 @@ while($interface = mysql_fetch_array($sql)){
<span style='font-size: 14px; font-weight: bold; margin: 5px; color: #c00;'>Port Down</span><br /> <span style='font-size: 14px; font-weight: bold; margin: 5px; color: #c00;'>Port Down</span><br />
<!-- <img src='graph.php?type=bits&if=".$interface['interface_id']."&from=$day&to=$now&width=100&height=32' /> --> <!-- <img src='graph.php?type=bits&if=".$interface['interface_id']."&from=$day&to=$now&width=100&height=32' /> -->
<strong>".generateiflink($interface, truncate(makeshortif($interface['label']),13,''))."</strong> <br /> <strong>".generateiflink($interface, truncate(makeshortif($interface['label']),13,''))."</strong> <br />
<span class=body-date-1>".truncate($interface['ifAlias'], 20, '')."</span> " . ($interface['ifAlias'] ? '<span class="body-date-1">'.truncate($interface['ifAlias'], 20, '').'</span>' : '') . "
</center>"); </center>");
} }

View File

@@ -289,13 +289,13 @@ function generateiflink($interface, $text=0,$type)
if($type) { $interface['graph_type'] = $type; } if($type) { $interface['graph_type'] = $type; }
if(!$interface['graph_type']) { $interface['graph_type'] = 'port_bits'; } if(!$interface['graph_type']) { $interface['graph_type'] = 'port_bits'; }
$class = ifclass($interface['ifOperStatus'], $interface['ifAdminStatus']); $class = ifclass($interface['ifOperStatus'], $interface['ifAdminStatus']);
$graph_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&from=$day&to=$now&width=400&height=100&type=" . $interface['graph_type']; $graph_url = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&amp;from=$day&amp;to=$now&amp;width=400&amp;height=100&amp;type=" . $interface['graph_type'];
$graph_url_month = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&from=$month&to=$now&width=400&height=100&type=" . $interface['graph_type']; $graph_url_month = $config['base_url'] . "/graph.php?port=" . $interface['interface_id'] . "&amp;from=$month&amp;to=$now&amp;width=400&amp;height=100&amp;type=" . $interface['graph_type'];
$device_id = getifhost($interface['interface_id']); $device_id = getifhost($interface['interface_id']);
$link = "<a class=$class href='".$config['base_url']."/device/$device_id/interface/" . $interface['interface_id'] . "/' "; $link = "<a class=$class href='".$config['base_url']."/device/$device_id/interface/" . $interface['interface_id'] . "/' ";
$link .= "onmouseover=\" return overlib('"; $link .= "onmouseover=\" return overlib('";
$link .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_month\'>', CAPTION, '<span class=list-large>" . $interface['hostname'] . " - " . fixifName($interface['label']) . "</span>"; $link .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_month\'>', CAPTION, '<span class=list-large>" . $interface['hostname'] . " - " . fixifName($interface['label']) . "</span>";
if($interface['ifAlias']) { $link .= "<br />" . $interface['ifAlias']; } if($interface['ifAlias']) { $link .= "<br />" . htmlentities($interface['ifAlias']); }
$link .= "' "; $link .= "' ";
$link .= $config['overlib_defaults'].");\" onmouseout=\"return nd();\" >$text</a>"; $link .= $config['overlib_defaults'].");\" onmouseout=\"return nd();\" >$text</a>";
@@ -309,18 +309,18 @@ function generatedevicelink($device, $text=0, $start=0, $end=0)
if(!$end) { $end = $now; } if(!$end) { $end = $now; }
$class = devclass($device); $class = devclass($device);
if(!$text) { $text = $device['hostname']; } if(!$text) { $text = $device['hostname']; }
$graph_url = $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&from=$start&to=$end&width=400&height=120&type=device_cpu"; $graph_url = $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&amp;from=$start&amp;to=$end&amp;width=400&amp;height=120&amp;type=device_cpu";
$graph_url_b = $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&from=$start&to=$end&width=400&height=120&type=device_memory"; $graph_url_b = $config['base_url'] . "/graph.php?device=" . $device['device_id'] . "&amp;from=$start&amp;to=$end&amp;width=400&amp;height=120&amp;type=device_memory";
$link = "<a class=$class href='".$config['base_url']."/device/" . $device['device_id'] . "/' "; $link = "<a class=$class href='".$config['base_url']."/device/" . $device['device_id'] . "/' ";
$link .= "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - CPU & Memory Usage</div>"; $link .= "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - CPU &amp; Memory Usage</div>";
$link .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_b\'>'".$config['overlib_defaults'].", LEFT);\" onmouseout=\"return nd();\">$text</a>"; $link .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_b\'>'".$config['overlib_defaults'].", LEFT);\" onmouseout=\"return nd();\">" . htmlentities($text) . "</a>";
return $link; return $link;
} }
function device_traffic_image($device, $width, $height, $from, $to) function device_traffic_image($device, $width, $height, $from, $to)
{ {
return "<img src='graph.php?device=" . $device . "&type=device_bits&from=" . $from . "&to=" . $to . "&width=" . $width . "&height=" . $height . "&legend=no' />"; return "<img src='graph.php?device=" . $device . "&amp;type=device_bits&amp;from=" . $from . "&amp;to=" . $to . "&amp;width=" . $width . "&amp;height=" . $height . "&amp;legend=no' />";
} }
function devclass($device) function devclass($device)