Commit version 24.12.13800
This commit is contained in:
@ -6,29 +6,26 @@
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage web
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
* @copyright (C) Adam Armstrong
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
if ($_SESSION['userlevel'] <= 7)
|
||||
{
|
||||
print_error_permission();
|
||||
return;
|
||||
if ($_SESSION['userlevel'] < 7) {
|
||||
print_error_permission();
|
||||
return;
|
||||
}
|
||||
|
||||
print generate_box_open();
|
||||
echo '<h2>Supported OS Types: '.safe_count($config['os']).'</h2>';
|
||||
echo '<h2>Supported OS Types: ' . safe_count($config['os']) . '</h2>';
|
||||
print generate_box_close();
|
||||
|
||||
foreach (dbFetchRows('SELECT `os`, COUNT(*) AS `count` FROM `devices` GROUP BY `os`') AS $row)
|
||||
{
|
||||
$oses[$row['os']] = $row['count'];
|
||||
foreach (dbFetchRows('SELECT `os`, COUNT(*) AS `count` FROM `devices` GROUP BY `os`') as $row) {
|
||||
$oses[$row['os']] = $row['count'];
|
||||
}
|
||||
|
||||
foreach ($config['device_types'] as $devtype)
|
||||
{
|
||||
$config['device_types'][$devtype['type']] = $devtype;
|
||||
foreach ($config['device_types'] as $devtype) {
|
||||
$config['device_types'][$devtype['type']] = $devtype;
|
||||
}
|
||||
|
||||
//r($oses);
|
||||
@ -61,26 +58,24 @@ echo '
|
||||
|
||||
ksort($config['os']);
|
||||
|
||||
foreach($config['os'] as $os_name => $os)
|
||||
{
|
||||
foreach ($config['os'] as $os_name => $os) {
|
||||
|
||||
$devtype = $config['device_types'][$os['type']];
|
||||
$devtype = $config['device_types'][$os['type']];
|
||||
|
||||
//r($devtype);
|
||||
//r($devtype);
|
||||
|
||||
if (isset($oses[$os_name]))
|
||||
{
|
||||
echo ' <tr data-toggle="collapse" data-target="#hidden-'.$os_name.'" class="clickable">';
|
||||
echo ' <td class="state-marker"></td>';
|
||||
echo ' <td class="text-center vertical-align" style="width: 64px; text-align: center;">'.get_device_icon(array('os' => $os_name)).'</td>';
|
||||
echo ' <td><span class="entity">'.$os['text'].'</span></td>';
|
||||
echo ' <td><span class="label label-primary">'.$os_name.'</span></td>';
|
||||
echo ' <td><span class="entity"><span class="'. $config['device_types'][$os['type']]['icon'].'"> </span> '. $os['type'].'</span></td>';
|
||||
echo ' <td>'.(isset($oses[$os_name]) ? '<a href="'.generate_url(array('page' => 'devices', 'os' => $os_name)).'">'.$oses[$os_name].' devices</a>' : '').'</td>';
|
||||
echo ' <td>'.safe_count($os['mibs']).'</td>';
|
||||
echo ' <td>'.safe_count($os['mib_blacklist']).'</td>';
|
||||
echo ' <td>'.safe_count($os['sysObjectID']).'</td>';
|
||||
echo ' </tr>';
|
||||
if (isset($oses[$os_name])) {
|
||||
echo ' <tr data-toggle="collapse" data-target="#hidden-' . $os_name . '" class="clickable">';
|
||||
echo ' <td class="state-marker"></td>';
|
||||
echo ' <td class="text-center vertical-align" style="width: 64px; text-align: center;">' . get_device_icon(['os' => $os_name]) . '</td>';
|
||||
echo ' <td><span class="entity">' . $os['text'] . '</span></td>';
|
||||
echo ' <td><span class="label label-primary">' . $os_name . '</span></td>';
|
||||
echo ' <td><span class="entity"><span class="' . $config['device_types'][$os['type']]['icon'] . '"> </span> ' . $os['type'] . '</span></td>';
|
||||
echo ' <td>' . (isset($oses[$os_name]) ? '<a href="' . generate_url(['page' => 'devices', 'os' => $os_name]) . '">' . $oses[$os_name] . ' devices</a>' : '') . '</td>';
|
||||
echo ' <td>' . safe_count($os['mibs']) . '</td>';
|
||||
echo ' <td>' . safe_count($os['mib_blacklist']) . '</td>';
|
||||
echo ' <td>' . safe_count($os['sysObjectID']) . '</td>';
|
||||
echo ' </tr>';
|
||||
|
||||
// echo ' <tr>';
|
||||
// echo ' <td colspan="8">';
|
||||
@ -89,7 +84,7 @@ foreach($config['os'] as $os_name => $os)
|
||||
// echo ' </tr>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
|
Reference in New Issue
Block a user