- Added a utility function formatCiscoHardware()

Params: - A reference to the $device array.
          - An optional (true) if you want the platform only (and not the part number)
- In device overview place Hardware before Operating System (makes more sence)
- Added virtual $device['hardware'] for Cisco platforms without an hardware tag (like Cisco 3750)


git-svn-id: http://www.observium.org/svn/observer/trunk@925 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Geert Hauwaerts
2010-02-21 17:02:20 +00:00
parent 8a299b6da2
commit d54df316ac
4 changed files with 32 additions and 10 deletions

View File

@ -7,30 +7,30 @@
# $uptime = @mysql_result(mysql_query("SELECT `attrib_value` FROM `devices_attribs` WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'uptime'"), 0);
$uptime = $device['uptime'];
if(is_file("images/devices/" . $device['hardware'] . ".gif")) {
$dev_img = "<div style='float: left;'><img src='images/devices/" . $device['hardware'] . ".gif' align=absmiddle></img></div>";
} elseif (is_file("images/devices/" . $device['hardware'] . ".jpg")) {
$dev_img = "<div style='float: left;'><img src='images/devices/" . $device['hardware'] . ".jpg' align=absmiddle></img></div>";
} else { unset($dev_img); }
if ($device['os'] == "ios") { formatCiscoHardware($device); }
if ($device['features']) { $device['features'] = "(".$device['features'].")"; }
$device['os_text'] = $os_text[$device[os]];
echo("$ddev_img
<table width=100%>
<tr>
<td class=list-bold>Operating System</td>
<td>" . $device['os_text'] . " " . $device['version'] . " " . $device['features'] . " </td>
</tr>");
<table width=100%>");
if($device['hardware']) {echo("<tr>
<td class=list-bold>Hardware</td>
<td>" . $device['hardware']. "</td>
</tr>"); }
echo("<tr>
<td class=list-bold>Operating System</td>
<td>" . $device['os_text'] . " " . $device['version'] . " " . $device['features'] . " </td>
</tr>");
if($device['sysContact']) {echo("<tr>
<td class=list-bold>Contact</td>
<td>" . htmlspecialchars($device['sysContact']). "</td>