updates - nice rounded corners on page search

git-svn-id: http://www.observium.org/svn/observer/trunk@445 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong 2009-08-07 16:10:52 +00:00
parent bd8fb496d4
commit 0e64ef858d
13 changed files with 254 additions and 57 deletions

View File

@ -1,33 +1,14 @@
<?php
echo("<table cellpadding=7 cellspacing=0 class=devicetable width=100%><tr><td>");
if($_GET['opta'] == "add") {
?>
<div style='font-size:20px; font-weight: bold;'>Add Bill</div>
<div style='padding:10px;font-size:20px; font-weight: bold;'>Add Bill</div>
<div style="margin:5px;">
<b class="rounded">
<b class="rounded1"><b></b></b>
<b class="rounded2"><b></b></b>
<b class="rounded3"></b>
<b class="rounded4"></b>
<b class="rounded5"></b></b>
<form method='post' action=''>
<div class="roundedfg" style="padding-left:10px;">
Content
</div>
<b class="rounded">
<b class="rounded5"></b>
<b class="rounded4"></b>
<b class="rounded3"></b>
<b class="rounded2"><b></b></b>
<b class="rounded1"><b></b></b></b>
</div>
@ -38,9 +19,21 @@ if($_GET['opta'] == "add") {
?>
<div style='margin:auto; text-align: center; margin-top: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; padding:5px;'>
<table cellpadding=7 cellspacing=0 class=devicetable width=100%>
<form method='post' action=''>
<tr bgcolor='#eeeeee'
<tr>
<td width='40' align=center valign=middle><div style='font-weight: bold; font-size: 16px;'>Bills</div></td>
<td width='240'><span style='font-weight: bold; font-size: 14px;'></span>
<input type="text" name="hostname" id="hostname" size=40 value="<?php echo($_POST['hostname']); ?>" />
@ -69,13 +62,24 @@ if($_GET['opta'] == "add") {
<input type=submit value=Search>
</td>
<td width='80' style='font-weight:bold; font-size: 12px;'>
<a><img src="images/16/add.png" align=absmiddle alt="Add"> Add Bill</a>
<a href='bills/add/'><img src="images/16/add.png" align=absmiddle alt="Add"> Add Bill</a>
</td>
</tr>
</form>
</table>
</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
<?php
<?php
$sql = "SELECT * FROM `bills` ORDER BY `bill_name`";
$query = mysql_query($sql);
@ -107,7 +111,7 @@ if($_GET['opta'] == "add") {
echo("
<tr bgcolor='$row_colour'>
<td width='7'></td>
<td width='250'><a href='".$config['base_url']."/bill/".$bill['bill_id']."'><span style='font-weight: bold;' class=interface>".$bill['bill_name']."</span></a></td>
<td width='250'><a href='".$config['base_url']."/bill/".$bill['bill_id']."/'><span style='font-weight: bold;' class=interface>".$bill['bill_name']."</span></a></td>
<td>$notes</td>
<td>$type</td>
<td>$allowed</td>
@ -117,9 +121,9 @@ if($_GET['opta'] == "add") {
<td width=60><a><img src='images/16/wrench.png' align=absmiddle alt='Edit'> Edit</a></td>
</tr>
");
$i++;
}
echo("</table>");
$i++;
}
echo("</td></tr></table>");

View File

@ -1,6 +1,16 @@
<?php // vim:fenc=utf-8:filetype=php:ts=4
echo("<div style='background-color: ".$list_colour_b."; margin: auto; margin-bottom: 5px; text-align: left; padding: 7px; padding-left: 11px; clear: both; display:block; height:20px;'>");
echo("<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; text-align: left; padding: 2px 5px; padding-left: 11px; clear: both; display:block; height:20px;'>
");
unset ($sep);
$query = mysql_query("SELECT `entSensorType` FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entSensorType != '' AND entSensorType NOT LIKE 'No%' GROUP BY `entSensorType` ORDER BY `entSensorType`");
while($data = mysql_fetch_array($query)) {
@ -13,7 +23,16 @@
$sep = ' | ';
}
unset ($sep);
echo("</div>");
echo("</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
");
$query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$device['device_id']."' and entSensorType = '".$_GET['opta']."' ORDER BY `entPhysicalName`");
while($data = mysql_fetch_array($query)) {

View File

@ -61,7 +61,6 @@ function printEntPhysical($ent, $level, $class) {
}
}
echo("<div style='float: left;'><h3>Inventory</h3></div>");
echo("<div style='float: right;'>
<a href='#' class='button' onClick=\"expandTree('enttree');return false;\"><img src='images/16/bullet_toggle_plus.png'>Expand All Nodes</a>
<a href='#' class='button' onClick=\"collapseTree('enttree');return false;\"><img src='images/16/bullet_toggle_minus.png'>Collapse All Nodes</a>

View File

@ -2,13 +2,10 @@
$query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,250";
$data = mysql_query($query);
echo("<table cellspacing=0 cellpadding=1 width=100%>");
while($entry = mysql_fetch_array($data)) {
include("includes/print-event.inc");
include("includes/print-event.inc");
}
echo("</table>");

View File

@ -15,7 +15,17 @@ $type_text['cemp'] = "Memory Pools";
$type_text['cpm'] = "Processor Usage";
$type_text['storage'] = "Disk Usage";
echo("<div style='width: auto; text-align: right; padding: 10px; display:block; background-color: #eeeeee;'>");
echo("<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; text-align: left; padding: 2px 5px; padding-left: 11px; clear: both; display:block; height:20px;'>
");
unset ($sep);
foreach ($datas as $type) {
if(!$_GET['opta']) { $_GET['opta'] = $type; }
@ -26,7 +36,17 @@ $type_text['storage'] = "Disk Usage";
$sep = ' | ';
}
unset ($sep);
echo("</div>");
echo("</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
");
if(is_file("pages/device/health/".mres($_GET['opta']).".inc.php")) { include("pages/device/health/".mres($_GET['opta']).".inc.php"); }

View File

@ -1,6 +1,15 @@
<?php
echo("
<div style='background-color: ".$list_colour_b."; margin: auto; margin-bottom: 5px; text-align: left; padding: 7px; padding-left: 11px; clear: both; display:block; height:20px;'>
<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; text-align: left; padding: 2px 5px; padding-left: 11px; clear: both; display:block; height:20px;'>
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/'>Basic</a> |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/details/'>Details</a> | Graphs:
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/bits/'>Bits</a>
@ -11,7 +20,16 @@ echo("
(<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/nupkts/thumbs/'>Mini</a>) |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/errors/'>Errors</a>
(<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/errors/thumbs/'>Mini</a>)</a>
</div> ");
</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
");
if($_GET['opta'] == graphs ) {
if($_GET['optb']) { $graph_type = $_GET['optb']; } else { $graph_type = "bits"; }

View File

@ -1,5 +1,13 @@
<div style="background-color: #eeeeee; padding: 10px;">
<form method="post" action="">
<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 5px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; text-align: left; padding: 5px 5px; padding-left: 11px; clear: both; display:block;'>
<form method="post" action="">
<label><strong>Search</strong>
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
</label>
@ -22,6 +30,14 @@
</form>
</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
<?php

View File

@ -1,17 +1,34 @@
<?php
echo("
<div style='background-color: ".$list_colour_b."; margin: auto; margin-bottom: 5px; text-align: left; padding: 7px; padding-left: 11px; clear: both; display:block; height:20px;'>
<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; text-align: left; padding: 2px 5px; padding-left: 11px; clear: both; display:block; height:20px;'>
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vrfs/'>Basic</a> | Graphs :
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vrfs/bits/'>Bits</a> |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vrfs/pkts/'>Packets</a> |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vrfs/nupkts/'>NU Packets</a> |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/vrfs/errors/'>Errors</a>
</div> ");
</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
");
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
$i = "1";
$i = "0";
$vrf_query = mysql_query("select * from vrfs WHERE device_id = '".$_GET['id']."' ORDER BY 'vrf_name'");
while($vrf = mysql_fetch_array($vrf_query)) {
include("includes/print-vrf.inc");

View File

@ -1,7 +1,16 @@
<table cellpadding=7 cellspacing=0 class=devicetable width=100%>
<div style='margin:auto; text-align: center; margin-top: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; padding:5px;'>
<table cellpadding=4 cellspacing=0 class=devicetable width=100%>
<form method='post' action=''>
<tr bgcolor='#eeeeee'
<td width='40' align=center valign=middle></td>
<tr>
<td width='30' align=center valign=middle></td>
<td width='300'><span style='font-weight: bold; font-size: 14px;'></span>
<input type="text" name="hostname" id="hostname" size=40 value="<?php echo($_POST['hostname']); ?>" />
</td>
@ -75,6 +84,16 @@
</tr>
</form>
</table>
</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
<?php

View File

@ -1,7 +1,17 @@
<table cellpadding=2 cellspacing=1 class=devicetable width=100%>
<tr bgcolor='#eeeeee' style='padding: 3px;'>
<div style='margin:auto; text-align: center; margin-top: 10px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; padding:5px;'>
<table style="text-align: left;" cellpadding=0 cellspacing=5 class=devicetable width=100%>
<tr style='padding: 0px;'>
<form method='post' action=''>
<td width='200' style="padding: 10px;">
<td width='200'>
<select name='device_id' id='device_id'>
<option value=''>All Devices</option>
<?php
@ -14,16 +24,22 @@
?>
</select>
</td>
<td>
<td width='150'>
<select name='state' id='state'>
<option value=''>All States</option>
<option value='up' <?php if($_POST['state'] == "up") { echo("selected"); } ?>>Up</option>
<option value='down'<?php if($_POST['state'] == "down") { echo("selected"); } ?>>Down</option>
<option value='admindown' <?php if($_POST['state'] == "admindown") { echo("selected"); } ?>>Shutdown</option>
<option value='errors' <?php if($_POST['state'] == "errors") { echo("selected"); } ?>>Errors</option>
<option value='ethernet' <?php if($_POST['state'] == "ethernet") { echo("selected"); } ?>>Ethernet</option>
<option value='l2vlan' <?php if($_POST['state'] == "l2vlan") { echo("selected"); } ?>>L2 VLAN</option>
<option value='sonet' <?php if($_POST['state'] == "sonet") { echo("selected"); } ?>>SONET</option>
<option value='propvirtual' <?php if($_POST['state'] == "propvirtual") { echo("selected"); } ?>>Virtual</option>
<option value='ppp' <?php if($_POST['state'] == "ppp") { echo("selected"); } ?>>PPP</option>
<option value='loopback' <?php if($_POST['state'] == "loopback") { echo("selected"); } ?>>Loopback</option>
</select>
</td>
<td>
<td width=110>
<select name='ifSpeed' id='ifSpeed'>
<option value=''>All Speeds</option>
<?php
@ -36,7 +52,7 @@
?>
</select>
</td>
<td>
<td width=200>
<select name='ifType' id='ifType'>
<option value=''>All Media</option>
<?php
@ -52,10 +68,24 @@
<td>
<input type="text" name="ifAlias" id="ifAlias" size=40 value="<?php echo($_POST['ifAlias']); ?>" />
Deleted <input type=checkbox id="deleted" name="deleted" value=1 <?php if($_POST['deleted']) { echo("checked"); } ?> ></input>
</td>
<td style="text-align: right;">
<input style="align:right;" type=submit value=Search></div>
</td>
</form>
</tr>
</table>
</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
<table cellpadding=3 cellspacing=0 class=devicetable width=100%>
<?php
@ -75,8 +105,22 @@ if($_GET['type'] == "down" || $_POST['state'] == "down") {
$where .= "AND ( I.`out_errors` > '0' OR I.`in_errors` > '0' )";
} elseif ($_GET['type'] == "up" || $_POST['state'] == "up") {
$where .= "AND I.ifOperStatus = 'up'";
} elseif ($_GET['type'] == "l2vlan" || $_POST['state'] == "l2vlan") {
$where .= " AND I.ifType = 'l2vlan'";
} elseif ($_GET['type'] == "ethernet" || $_POST['state'] == "ethernet") {
$where .= " AND I.ifType = 'ethernetCsmacd'";
} elseif ($_GET['type'] == "loopback" || $_POST['state'] == "loopback") {
$where .= " AND I.ifType = 'softwareLoopback'";
} elseif ($_GET['typee'] == "sonet" || $_POST['state'] == "sonet") {
$where .= " AND I.ifType = 'sonet'";
} elseif ($_POST['state'] == "propvirtual") {
$where .= " AND I.ifType = 'propVirtual'";
} elseif ($_POST['state'] == "ppp") {
$where .= " AND I.ifType = 'ppp'";
}
if($_POST['device_id']) { $where .= " AND I.device_id = '".$_POST['device_id']."'"; }
if($_POST['ifType']) { $where .= " AND I.ifType = '".$_POST['ifType']."'"; }
if($_POST['ifSpeed']) { $where .= " AND I.ifSpeed = '".$_POST['ifSpeed']."'"; }
@ -87,7 +131,7 @@ $sql = "SELECT * FROM `interfaces` AS I, `devices` AS D WHERE I.device_id = D.de
$query = mysql_query($sql);
echo("<tr class=tablehead><th>Device</a></th><th>Interface</th><th>Speed</th><th>Media</th><th>Description</th></tr>");
echo("<tr class=tablehead><td></td><th>Device</a></th><th>Interface</th><th>Speed</th><th>Media</th><th>Description</th></tr>");
$row = 1;
@ -105,10 +149,11 @@ while($interface = mysql_fetch_array($query)) {
if( interfacepermitted($interface['interface_id']) )
{
echo("<tr bgcolor=$row_colour>
<td class=list-bold>" . generatedevicelink($interface) . "</td>
<td class=list-bold>" . generateiflink($interface, makeshortif(fixifname($interface['ifDescr']))) . " $error_img</td>
<td>$speed</td>
<td>$type</td>
<td width=5></td>
<td width=200 class=list-bold>" . generatedevicelink($interface) . "</td>
<td width=150 class=list-bold>" . generateiflink($interface, makeshortif(fixifname($interface['ifDescr']))) . " $error_img</td>
<td width=110 >$speed</td>
<td width=200>$type</td>
<td>" . $interface['ifAlias'] . "</td>
</tr>\n");

View File

@ -1,5 +1,13 @@
<meta http-equiv="refresh" content="60">
<div style="background-color: #eeeeee; padding: 10px;">
<div style='margin:auto; text-align: center; margin-top: 0px; margin-bottom: 0px;'>
<b class='rounded'>
<b class='rounded1'><b></b></b>
<b class='rounded2'><b></b></b>
<b class='rounded3'></b>
<b class='rounded4'></b>
<b class='rounded5'></b></b>
<div class='roundedfg' style='padding: 0px 5px;'>
<div style='margin: auto; text-align: left; padding: 5px 5px; padding-left: 11px; clear: both; display:block;'>
<form method="post" action="">
<label><strong>Search</strong>
<input type="text" name="string" id="string" value="<?php echo($_POST['string']); ?>" />
@ -39,6 +47,14 @@
</form>
</div>
</div>
<b class='rounded'>
<b class='rounded5'></b>
<b class='rounded4'></b>
<b class='rounded3'></b>
<b class='rounded2'><b></b></b>
<b class='rounded1'><b></b></b></b>
</div>
<?

View File

@ -393,6 +393,32 @@ function delHost($id)
echo("Removed device $host<br />");
}
function retireHost($id)
{
global $config;
$host = mysql_result(mysql_query("SELECT hostname FROM devices WHERE device_id = '$id'"), 0);
mysql_query("DELETE FROM `devices` WHERE `device_id` = '$id'");
$int_query = mysql_query("SELECT * FROM `interfaces` WHERE `device_id` = '$id'");
while($int_data = mysql_fetch_array($int_query)) {
$int_if = $int_data['ifDescr'];
$int_id = $int_data['interface_id'];
mysql_query("DELETE from `adjacencies` WHERE `interface_id` = '$int_id'");
mysql_query("DELETE from `links` WHERE `src_if` = '$int_id'");
mysql_query("DELETE from `links` WHERE `dst_if` = '$int_id'");
mysql_query("DELETE from `ipaddr` WHERE `interface_id` = '$int_id'");
mysql_query("DELETE from `ip6adjacencies` WHERE `interface_id` = '$int_id'");
mysql_query("DELETE from `ip6addr` WHERE `interface_id` = '$int_id'");
mysql_query("DELETE from `pseudowires` WHERE `interface_id` = '$int_id'");
echo("Removed interface $int_id ($int_if)<br />");
}
mysql_query("DELETE FROM `entPhysical` WHERE `device_id` = '$id'");
mysql_query("DELETE FROM `temperature` WHERE `temp_host` = '$id'");
mysql_query("DELETE FROM `storage` WHERE `host_id` = '$id'");
mysql_query("DELETE FROM `alerts` WHERE `device_id` = '$id'");
mysql_query("DELETE FROM `services` WHERE `service_host` = '$id'");
shell_exec("rm -rf ".$config['rrd_dir']."/$host");
echo("Removed device $host<br />");
}
function addHost($host, $community, $snmpver, $port = 161)
{

View File

@ -118,6 +118,7 @@ $rewrite_ios_features = array(
'dialer' => 'Di',
'vlan' => 'Vlan',
'tunnel' => 'Tunnel',
'serviceinstance' => 'SI',
);
$rewrite_iftype = array (