diff --git a/html/css/styles.css b/html/css/styles.css index e7a5736cdd..a309e9ab10 100644 --- a/html/css/styles.css +++ b/html/css/styles.css @@ -1872,7 +1872,6 @@ label { .device-availability, .service-availability { color:#000000; float:left; - width:163px; height:64px; margin:10px; padding:8px; @@ -1991,3 +1990,7 @@ label { float:left; background-color: #D9534F; } + +.availability-map-widget-header { + line-height:30px; +} diff --git a/html/includes/common/availability-map.inc.php b/html/includes/common/availability-map.inc.php index 80cd4b38da..cc00b3dcae 100644 --- a/html/includes/common/availability-map.inc.php +++ b/html/includes/common/availability-map.inc.php @@ -12,70 +12,58 @@ * the source code distribution for details. */ +$sql = dbFetchRow('SELECT `settings` FROM `users_widgets` WHERE `user_id` = ? AND `widget_id` = ?', array($_SESSION["user_id"], '1')); +$widget_mode = json_decode($sql['settings'], true); + +if (isset($_SESSION["map_view"]) && is_numeric($_SESSION["map_view"])) { + $mode = $_SESSION["map_view"]; +} else { + $mode = $widget_mode->{'mode'}; +} + $select_modes = array( '0' => 'only devices', '1' => 'only services', '2' => 'devices and services', ); -if (defined('SHOW_SETTINGS')) { - if (isset($widget_settings['mode'])) { - $mode = $widget_settings['mode']; - } else { - $mode = 0; - } +if ($config['webui']['availability_map_compact'] == 1) { + $compact_tile = $widget_mode->{'tile_width'}; +} - if (isset($widget_settings['tile_width'])) { - $current_width = $widget_settings['tile_width']; - } else { - $current_width = 10; +if (defined('SHOW_SETTINGS')) { + $common_output[] = ' +
'; } else { require_once 'includes/object-cache.inc.php'; - - $sql = dbFetchRow('SELECT `settings` FROM `users_widgets` WHERE `user_id` = ? AND `widget_id` = ?', array($_SESSION["user_id"], '1')); - $widget_mode = json_decode($sql['settings']); - - if (isset($_SESSION["map_view"])) { - $mode = $_SESSION["map_view"]; - } else { - $mode = $widget_mode->{'mode'}; - } - $host_up_count = 0; $host_warn_count = 0; $host_down_count = 0; @@ -116,9 +104,9 @@ if (defined('SHOW_SETTINGS')) { 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."`"; + $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."`"; + $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `" . $deviceOrderBy . "`"; } $temp_output = array(); @@ -143,31 +131,31 @@ if (defined('SHOW_SETTINGS')) { $host_down_count++; } - if ($config['webui']['old_availability_map'] == 0) { + if ($config['webui']['availability_map_compact'] == 0) { if ($directpage == "yes") { $deviceIcon = getImage($device); $temp_output[] = ' - -