diff --git a/html/css/styles.css b/html/css/styles.css index e7a5736cdd..7e3fe078e1 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; diff --git a/html/includes/common/availability-map.inc.php b/html/includes/common/availability-map.inc.php index 80cd4b38da..7a3bf215bd 100644 --- a/html/includes/common/availability-map.inc.php +++ b/html/includes/common/availability-map.inc.php @@ -19,50 +19,21 @@ $select_modes = array( ); if (defined('SHOW_SETTINGS')) { - if (isset($widget_settings['mode'])) { - $mode = $widget_settings['mode']; - } else { - $mode = 0; - } - - if (isset($widget_settings['tile_width'])) { - $current_width = $widget_settings['tile_width']; - } else { - $current_width = 10; - } - $common_output[] = ' -
-
- -
- + +
+
+ +
+
+ +
-
-
- -
- +
+
+ +
-
-
-
-
'; } else { require_once 'includes/object-cache.inc.php'; @@ -116,9 +87,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 +114,31 @@ if (defined('SHOW_SETTINGS')) { $host_down_count++; } - if ($config['webui']['old_availability_map'] == 0) { + if ($config['webui']['availability_map_old'] == 0) { if ($directpage == "yes") { $deviceIcon = getImage($device); $temp_output[] = ' - -
- '.$deviceState.' - '.$deviceIcon.'
- '.shorthost(ip_to_sysname($device, $device['hostname'])).' +
+
+ ' . $deviceState . ' + ' . $deviceIcon . '
+ ' . shorthost(ip_to_sysname($device, $device['hostname'])) . '
'; } else { $temp_output[] = ' - - '.$deviceState.' + + ' . $deviceState . ' '; } } else { - $temp_output[] = '
'; + $temp_output[] = '
'; } } } if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { - $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`os`, `D`.`icon` from services S, devices D where `S`.`device_id` = `D`.`device_id` ORDER BY '.$serviceOrderBy.';'; + $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`sysName`, `D`.`device_id`, `D`.`os`, `D`.`icon` from services S, devices D where `S`.`device_id` = `D`.`device_id` ORDER BY ' . $serviceOrderBy . ';'; $services = dbFetchRows($service_query); if (count($services) > 0) { foreach ($services as $service) { @@ -188,26 +159,26 @@ if (defined('SHOW_SETTINGS')) { $service_down_count++; } - if ($config['webui']['old_availability_map'] == 0) { + if ($config['webui']['availability_map_old'] == 0) { if ($directpage == "yes") { $deviceIcon = getImage($service); $temp_output[] = ' - -
- '.$service["service_type"].' - '.$serviceState.' - '.$deviceIcon.'
- '.shorthost(ip_to_sysname($service, $service['hostname'])).' +
+
+ ' . $service["service_type"] . ' + ' . $serviceState . ' + ' . $deviceIcon . '
+ ' . shorthost(ip_to_sysname($service, $service['hostname'])) . '
'; } else { $temp_output[] = ' - - '.$service['service_type'].' - '.$serviceState.' + + ' . $service['service_type'] . ' - ' . $serviceState . ' '; } } else { - $temp_output[] = '
'; + $temp_output[] = '
'; } } } else { @@ -230,7 +201,7 @@ if (defined('SHOW_SETTINGS')) { } else { $selected = ''; } - $temp_header[] = ''; + $temp_header[] = ''; } } @@ -252,7 +223,7 @@ if (defined('SHOW_SETTINGS')) { $temp_header[] = ' Device group '; } @@ -276,21 +247,21 @@ if (defined('SHOW_SETTINGS')) { if ($mode == 0 || $mode == 2) { $temp_header[] = ' -
+
Total hosts - up: '.$host_up_count.' - warn: '.$host_warn_count.' - down: '.$host_down_count.' + up: ' . $host_up_count . ' + warn: ' . $host_warn_count . ' + down: ' . $host_down_count . '
'; } if (($mode == 1 || $mode == 2) && ($config['show_services'] != 0)) { $temp_header[] = ' -
+
Total services - up: '.$service_up_count.' - warn: '.$service_warn_count.' - down: '.$service_down_count.' + up: ' . $service_up_count . ' + warn: ' . $service_warn_count . ' + down: ' . $service_down_count . '
'; } diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 18dae548f6..1bb1567a59 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -1219,6 +1219,11 @@ function generate_dynamic_config_panel($title, $config_groups, $items = array(), '; + } elseif ($item['type'] == 'numeric') { + $output .= ' + + + '; } elseif ($item['type'] == 'select') { $output .= '