From d54df316acbe9be6163d78fdf8da9ee05566fb74 Mon Sep 17 00:00:00 2001 From: Geert Hauwaerts Date: Sun, 21 Feb 2010 17:02:20 +0000 Subject: [PATCH] - 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 --- html/includes/dev-overview-data.inc.php | 16 ++++++++-------- html/includes/hostbox.inc | 2 +- includes/defaults.inc.php | 2 ++ includes/functions.php | 22 +++++++++++++++++++++- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/html/includes/dev-overview-data.inc.php b/html/includes/dev-overview-data.inc.php index f99ea77f0..70909db70 100644 --- a/html/includes/dev-overview-data.inc.php +++ b/html/includes/dev-overview-data.inc.php @@ -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 = "
"; } elseif (is_file("images/devices/" . $device['hardware'] . ".jpg")) { $dev_img = "
"; } 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 - - - - - "); - +
Operating System" . $device['os_text'] . " " . $device['version'] . " " . $device['features'] . "
"); + if($device['hardware']) {echo(""); } + echo(" + + + "); + if($device['sysContact']) {echo(" diff --git a/html/includes/hostbox.inc b/html/includes/hostbox.inc index 3938e28d2..f7e56c61a 100644 --- a/html/includes/hostbox.inc +++ b/html/includes/hostbox.inc @@ -11,7 +11,7 @@ unset($image); $image = getImage($device['device_id']); - + if ($device['os'] == "ios") { formatCiscoHardware($device, true); } $device['os_text'] = $os_text[$device['os']]; echo('
Hardware " . $device['hardware']. "
Operating System" . $device['os_text'] . " " . $device['version'] . " " . $device['features'] . "
Contact " . htmlspecialchars($device['sysContact']). "