diff --git a/html/css/styles.css b/html/css/styles.css
index 1b2f7f7d9b..e0b0caef57 100644
--- a/html/css/styles.css
+++ b/html/css/styles.css
@@ -1872,7 +1872,7 @@ label {
.device-availability, .service-availability {
color:#000000;
float:left;
- width:125px;
+ width:163px;
height:64px;
margin:10px;
padding:8px;
diff --git a/html/includes/common/availability-map.inc.php b/html/includes/common/availability-map.inc.php
index e23961dafe..80cd4b38da 100644
--- a/html/includes/common/availability-map.inc.php
+++ b/html/includes/common/availability-map.inc.php
@@ -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[] = '
Device group