amap device box reverted to original size, fixes for device groups (#4334)

This commit is contained in:
crcro
2016-09-04 15:04:53 +03:00
committed by Tony Murray
parent 1174954ac4
commit 8ce1d81b71
2 changed files with 12 additions and 9 deletions

View File

@ -1872,7 +1872,7 @@ label {
.device-availability, .service-availability {
color:#000000;
float:left;
width:125px;
width:163px;
height:64px;
margin:10px;
padding:8px;

View File

@ -93,13 +93,15 @@ if (defined('SHOW_SETTINGS')) {
if ($mode == 0 || $mode == 2) {
// Only show devices if mode is 0 or 2 (Only Devices or both)
$device_group = 'SELECT `D`.`device_id` FROM `device_group_device` AS `D` WHERE `device_group_id` = ?';
$param = array($_SESSION['group_view']);
$devices = dbFetchRows($device_group, $param);
foreach ($devices as $in_dev) {
$in_devices[] = $in_dev['device_id'];
if ($config['webui']['availability_map_use_device_groups'] != 0) {
$device_group = 'SELECT `D`.`device_id` FROM `device_group_device` AS `D` WHERE `device_group_id` = ?';
$param = array($_SESSION['group_view']);
$devices = dbFetchRows($device_group, $param);
foreach ($devices as $in_dev) {
$in_devices[] = $in_dev['device_id'];
}
$in_devices = implode(',', $in_devices);
}
$in_devices = implode(',', $in_devices);
$sql = 'SELECT `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`status`, `D`.`uptime`, `D`.`os`, `D`.`icon` FROM `devices` AS `D`';
@ -112,7 +114,8 @@ if (defined('SHOW_SETTINGS')) {
$sql .= ' WHERE';
}
if ($config['webui']['availability_map_use_device_groups'] != 0) {
if ($config['webui']['availability_map_use_device_groups'] != 0 && isset($in_devices)) {
$sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' AND `D`.`device_id` IN (".$in_devices.") ORDER BY `".$deviceOrderBy."`";
} else {
$sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `".$deviceOrderBy."`";
@ -249,7 +252,7 @@ if (defined('SHOW_SETTINGS')) {
$temp_header[] = '
<span class="page-availability-title">Device group</span>
<select id="group" class="page-availability-report-select" name="group">
<option value="0" '.$selected.'>select device group</option>';
<option value="0" '.$selected.'>show all devices</option>';
foreach ($dev_groups as $dev_group) {
if ($_SESSION['group_view'] == $dev_group['id']) {