2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($device['status'] == '0') {
|
|
|
|
|
$class = 'alert-danger';
|
2016-08-18 20:28:22 -05:00
|
|
|
} else {
|
2015-07-13 20:10:26 +02:00
|
|
|
$class = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($device['ignore'] == '1') {
|
|
|
|
|
$class = 'div-ignore-alert';
|
|
|
|
|
if ($device['status'] == '1') {
|
|
|
|
|
$class = 'alert-warning';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($device['disabled'] == '1') {
|
|
|
|
|
$class = 'alert-info';
|
2011-04-21 12:59:44 +00:00
|
|
|
}
|
|
|
|
|
|
2017-01-26 22:38:43 +00:00
|
|
|
$host_id = get_vm_parent_id($device);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
echo '
|
2017-02-14 10:52:17 +02:00
|
|
|
<colgroup>
|
|
|
|
|
<col class="device-title-bar-1">
|
|
|
|
|
<col class="device-title-bar-2">
|
|
|
|
|
<col class="device-title-bar-3">
|
|
|
|
|
</colgroup>
|
2014-01-13 10:05:19 +00:00
|
|
|
<tr bgcolor="'.$device_colour.'" class="alert '.$class.'">
|
2017-01-24 16:16:01 -06:00
|
|
|
<td><span class="device-icon-48h">'.getLogoTag($device).'</span></td>
|
2016-01-25 22:04:12 +00:00
|
|
|
<td>';
|
|
|
|
|
if ($host_id > 0) {
|
|
|
|
|
echo '
|
|
|
|
|
<a href="'.generate_url(array('page'=>'device','device'=>$host_id)).'"><i class="fa fa-server fa-fw fa-lg"></i></a>
|
|
|
|
|
';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo '
|
|
|
|
|
<span style="font-size: 20px;">'.generate_device_link($device).'</span>
|
2015-11-27 07:27:54 -08:00
|
|
|
<br />'.generate_link($device['location'], array('page' => 'devices', 'location' => $device['location'])).'</td>
|
2015-07-13 20:10:26 +02:00
|
|
|
<td>';
|
2011-09-19 02:20:16 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if (isset($config['os'][$device['os']]['over'])) {
|
|
|
|
|
$graphs = $config['os'][$device['os']]['over'];
|
2016-08-18 20:28:22 -05:00
|
|
|
} elseif (isset($device['os_group']) && isset($config['os'][$device['os_group']]['over'])) {
|
2015-07-13 20:10:26 +02:00
|
|
|
$graphs = $config['os'][$device['os_group']]['over'];
|
2016-08-18 20:28:22 -05:00
|
|
|
} else {
|
2015-07-13 20:10:26 +02:00
|
|
|
$graphs = $config['os']['default']['over'];
|
2012-05-20 19:57:11 +00:00
|
|
|
}
|
2011-09-19 02:20:16 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$graph_array = array();
|
|
|
|
|
$graph_array['height'] = '100';
|
|
|
|
|
$graph_array['width'] = '310';
|
|
|
|
|
$graph_array['to'] = $config['time']['now'];
|
|
|
|
|
$graph_array['device'] = $device['device_id'];
|
|
|
|
|
$graph_array['type'] = 'device_bits';
|
|
|
|
|
$graph_array['from'] = $config['time']['day'];
|
|
|
|
|
$graph_array['legend'] = 'no';
|
2012-05-20 19:57:11 +00:00
|
|
|
$graph_array['popup_title'] = $descr;
|
2011-09-19 02:20:16 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$graph_array['height'] = '45';
|
|
|
|
|
$graph_array['width'] = '150';
|
|
|
|
|
$graph_array['bg'] = 'FFFFFF00';
|
2011-09-19 02:20:16 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
foreach ($graphs as $entry) {
|
|
|
|
|
if ($entry['graph']) {
|
|
|
|
|
$graph_array['type'] = $entry['graph'];
|
2011-09-19 02:20:16 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
echo "<div style='float: right; text-align: center; padding: 1px 5px; margin: 0 1px; ' class='rounded-5px'>";
|
|
|
|
|
print_graph_popup($graph_array);
|
|
|
|
|
echo "<div style='font-weight: bold; font-size: 7pt; margin: -3px;'>".$entry['text'].'</div>';
|
|
|
|
|
echo '</div>';
|
|
|
|
|
}
|
2012-05-20 19:57:11 +00:00
|
|
|
}
|
2011-09-19 02:20:16 +00:00
|
|
|
|
2012-05-20 19:57:11 +00:00
|
|
|
unset($graph_array);
|
2011-09-19 02:20:16 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
echo '</td>
|
|
|
|
|
</tr>';
|