2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
2011-03-31 17:19:54 +00:00
|
|
|
if ($bg == $list_colour_b) { $bg = $list_colour_a; } else { $bg = $list_colour_b; }
|
2011-04-20 17:03:54 +00:00
|
|
|
|
|
|
|
if ($device['status'] == '0')
|
|
|
|
{
|
2011-04-20 17:18:07 +00:00
|
|
|
$tr = "row-alert";
|
2011-04-20 17:03:54 +00:00
|
|
|
$class = "list-device-down";
|
|
|
|
} else {
|
|
|
|
$class = "list-device"; unset ($tr);
|
|
|
|
}
|
|
|
|
if ($device['ignore'] == '1')
|
2011-03-31 17:19:54 +00:00
|
|
|
{
|
2011-04-20 17:03:54 +00:00
|
|
|
$tr = "bordercolor=#eeeeee";
|
2011-03-31 17:19:54 +00:00
|
|
|
$class = "list-device-ignored";
|
|
|
|
if ($device['status'] == '1') { $class = "list-device-ignored-up"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
$type = strtolower($device['os']);
|
|
|
|
unset($image);
|
|
|
|
|
|
|
|
$image = getImage($device['device_id']);
|
|
|
|
if ($device['os'] == "ios") { formatCiscoHardware($device, true); }
|
|
|
|
$device['os_text'] = $config['os'][$device['os']]['text'];
|
|
|
|
|
|
|
|
$port_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `device_id` = '".$device['device_id']."'"),0);
|
|
|
|
$sensor_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = '".$device['device_id']."'"),0);
|
|
|
|
|
2011-04-20 17:22:21 +00:00
|
|
|
echo(' <tr class="'.$class.'" bgcolor="' . $bg . '" onmouseover="this.style.backgroundColor=\'#fdd\';" onmouseout="this.style.backgroundColor=\'' . $bg . '\';"
|
2011-04-13 19:46:49 +00:00
|
|
|
onclick="location.href=\'device/'.$device['device_id'].'/\'" style="cursor: pointer;">
|
2011-03-31 17:19:54 +00:00
|
|
|
<td width="40" align="center" valign="middle">' . $image . '</td>
|
|
|
|
<td width="300"><span style="font-weight: bold; font-size: 14px;">' . generate_device_link($device) . '</span>
|
2011-04-20 16:47:36 +00:00
|
|
|
<br />' . $device['sysName'] . '</td>'
|
|
|
|
);
|
2010-09-26 22:10:04 +00:00
|
|
|
|
2011-04-20 16:47:36 +00:00
|
|
|
echo ('<td width="55">');
|
2011-03-31 17:19:54 +00:00
|
|
|
if ($port_count) { echo(' <img src="images/icons/port.png" align=absmiddle /> '.$port_count); }
|
|
|
|
echo('<br />');
|
|
|
|
if ($sensor_count) { echo(' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count); }
|
2011-04-20 16:47:36 +00:00
|
|
|
echo ('</td>');
|
2011-03-31 17:19:54 +00:00
|
|
|
|
2011-04-20 16:47:36 +00:00
|
|
|
echo(' <td>' . $device['hardware'] . '<br />' . $device['features'] . '</td>');
|
|
|
|
|
|
|
|
echo(' <td>' . $device['os_text'] . '<br />' . $device['version'] . '</td>');
|
|
|
|
|
2011-04-20 16:53:20 +00:00
|
|
|
echo(' <td>' . formatUptime($device['uptime']) . ' <br />');
|
2011-04-20 16:47:36 +00:00
|
|
|
|
2011-04-20 16:53:20 +00:00
|
|
|
if (get_dev_attrib($device,'override_sysLocation_bool')) { $device['location'] = get_dev_attrib($device,'override_sysLocation_string'); }
|
2011-04-20 17:03:54 +00:00
|
|
|
echo(' ' . truncate($device['location'],32, '') . '</td>');
|
2011-04-20 16:47:36 +00:00
|
|
|
|
|
|
|
echo (' </tr>');
|
2011-03-31 17:19:54 +00:00
|
|
|
|
2011-04-20 16:47:36 +00:00
|
|
|
?>
|