From 655363082c7ad89ed7f602cda0c5d59eece25b98 Mon Sep 17 00:00:00 2001 From: crcro Date: Fri, 12 Aug 2016 22:51:29 +0300 Subject: [PATCH 1/7] rewrite of availability-map --- html/ajax_mapview.php | 7 + html/css/light.css | 98 ++++++++ html/includes/common/availability-map.inc.php | 222 ++++++++++++------ html/js/librenms.js | 13 +- html/pages/availability-map.inc.php | 3 +- 5 files changed, 273 insertions(+), 70 deletions(-) create mode 100644 html/ajax_mapview.php diff --git a/html/ajax_mapview.php b/html/ajax_mapview.php new file mode 100644 index 0000000000..bfc2d19e0b --- /dev/null +++ b/html/ajax_mapview.php @@ -0,0 +1,7 @@ + * Copyright (c) 2016 Jens Langhammer + * Copyright (c) 2016 Cercel Valentin * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ - if (defined('show_settings')) { $current_mode = isset($widget_settings['mode']) ? $widget_settings['mode'] : 0; $current_width = isset($widget_settings['tile_width']) ? $widget_settings['tile_width'] : 10; - $common_output[] = ' -
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
-
- '; -} -else { + + $common_output[] = '
'; + $common_output[] = '
'; + $common_output[] = ''; + $common_output[] = '
'; + $common_output[] = ''; + $common_output[] = '
'; + $common_output[] = '
'; + $common_output[] = '
'; + $common_output[] = ''; + $common_output[] = '
'; + $common_output[] = ''; + $common_output[] = '
'; + $common_output[] = '
'; + $common_output[] = '
'; + $common_output[] = '
'; + $common_output[] = ''; + $common_output[] = '
'; + $common_output[] = '
'; + $common_output[] = '
'; + +} else { require_once 'includes/object-cache.inc.php'; - $mode = isset($widget_settings['mode']) ? $widget_settings['mode'] : 0; + $mode = isset($_SESSION["mapView"]) ? $_SESSION["mapView"] : 0; + + $widget_mode = isset($widget_settings['mode']) ? $widget_settings['mode'] : 0; $tile_width = isset($widget_settings['tile_width']) ? $widget_settings['tile_width'] : 10; - $up_count = 0; - $warn_count = 0; - $down_count = 0; + $host_up_count = 0; + $host_warn_count = 0; + $host_down_count = 0; + $service_up_count = 0; + $service_down_count = 0; if ($mode == 0 || $mode == 2) { // Only show devices if mode is 0 or 2 (Only Devices or both) - $sql = 'SELECT `D`.`hostname`,`D`.`device_id`,`D`.`status`,`D`.`uptime` FROM `devices` AS `D`'; + $sql = 'SELECT `D`.`hostname`,`D`.`device_id`,`D`.`status`,`D`.`uptime`, `D`.`os` FROM `devices` AS `D`'; if (is_normal_user() === true) { $sql .= ' , `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = ? AND'; $param = array( $_SESSION['user_id'] - ); - } - else { + ); + } else { $sql .= ' WHERE'; } $sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `hostname`"; @@ -67,49 +69,135 @@ else { foreach (dbFetchRows($sql, $param) as $device) { if ($device['status'] == '1') { if (($device['uptime'] < $config['uptime_warning']) && ($device['uptime'] != '0')) { - $btn_type = 'btn-warning'; - $warn_count++; + $deviceState = 'warning'; + $deviceLabel = 'label-warning'; + $host_warn_count++; + } else { + $deviceState = 'up'; + $deviceLabel = 'label-success'; + $host_up_count++; } - else { - $btn_type = 'btn-success'; - $up_count ++; - } - } - else { - $btn_type = 'btn-danger'; - $down_count++; + } else { + $deviceState = 'down'; + $deviceLabel = 'label-danger'; + $host_down_count++; + } + + if($directpage == "yes") + { + $deviceIcon = getImage($device); + $temp_output[] = ''; + $temp_output[] = '
'; + $temp_output[] = ''; + $temp_output[] = '' . $deviceIcon . '
'; + $temp_output[] = '' . $device["hostname"] . ''; + $temp_output[] = '
'; + } else { + $temp_output[] = ''; + $temp_output[] = ''; + $temp_output[] = ''; } - $temp_output[] = ''; } } if ($mode == 1 || $mode == 2) { - $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`device_id` from services S, devices D where `S`.`device_id` = `D`.`device_id`;'; + $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`device_id`, `D`.`os` from services S, devices D where `S`.`device_id` = `D`.`device_id`;'; foreach (dbFetchRows($service_query) as $service) { if ($service['service_status'] == '0') { - $btn_type = 'btn-success'; - $up_count ++; - } - else { - $btn_type = 'btn-danger'; - $down_count += 1; + $serviceLabel = "label-success"; + $serviceState = "up"; + $service_up_count++; + } else { + $serviceLabel = "label-danger"; + $serviceState = "down"; + $service_down_count += 1; } - $temp_output[] = ''; + if($directpage == "yes") + { + $deviceIcon = getImage($service); + $temp_output[] = ''; + $temp_output[] = '
'; + $temp_output[] = ''; + $temp_output[] = ''; + $temp_output[] = '' . $deviceIcon . '
'; + $temp_output[] = '' . $service["hostname"] . ''; + $temp_output[] = '
'; + } else { + $temp_output[] = ''; + $temp_output[] = ''; + $temp_output[] = ''; + } } } - $temp_output[] = ''; - $temp_header = array( - '
'.$up_count.' '.$warn_count.' '.$down_count.'

' - ); + if($directpage == "yes") + { + $temp_header[] = '
'; + $temp_header[] = 'Availability map for'; + $temp_header[] = '
'; + $temp_header[] = '
'; + + } + + + if ($mode == 0 || $mode == 2) + { + if($directpage == "yes") + { + $temp_header[] = '
'; + $temp_header[] = 'Hosts report:'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
' . $host_up_count . '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
' . $host_warn_count . '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
' . $host_down_count . '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + } else { + $temp_header[] = '
Total hosts '.$host_up_count.' '.$host_warn_count.' '.$host_down_count.'
'; + } + + } + + if ($mode == 1 || $mode == 2) + { + if($directpage == "yes") + { + + $temp_header[] = '
'; + $temp_header[] = 'Services report:'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
' . $service_up_count . '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + $temp_header[] = '
' . $service_down_count . '
'; + $temp_header[] = '
'; + $temp_header[] = '
'; + } else { + $temp_header[] = '
Total services '.$service_up_count.' '.$service_down_count.'
'; + } + } + + $temp_header[] = '
'; + $temp_header[] = '
'; + $common_output = array_merge($temp_header, $temp_output); -} +} \ No newline at end of file diff --git a/html/js/librenms.js b/html/js/librenms.js index f103ea29b0..84cc1b6694 100644 --- a/html/js/librenms.js +++ b/html/js/librenms.js @@ -225,6 +225,17 @@ $(document).on("click", '.collapse-neighbors', function(event) }); +$(document).on("change", '#mode', function() { + $.post('ajax_mapview.php', + { + mapView: $(this).val() + }, + function(data) { + location.reload(); + },'json' + ); +}); + $(document).ready(function() { var lines = 'on'; $("#linenumbers").button().click(function() { @@ -243,4 +254,4 @@ $(document).ready(function() { }); } }); -}); +}); \ No newline at end of file diff --git a/html/pages/availability-map.inc.php b/html/pages/availability-map.inc.php index b5ede4e144..2b86db8361 100644 --- a/html/pages/availability-map.inc.php +++ b/html/pages/availability-map.inc.php @@ -1,6 +1,5 @@ -

Availability Map

-
Date: Sat, 13 Aug 2016 03:20:55 +0300 Subject: [PATCH 2/7] added linux os distro icon, fixed formatting --- html/ajax_mapview.php | 2 +- html/css/light.css | 18 +++++------ html/includes/common/availability-map.inc.php | 31 +++++++------------ html/js/librenms.js | 2 +- 4 files changed, 22 insertions(+), 31 deletions(-) diff --git a/html/ajax_mapview.php b/html/ajax_mapview.php index bfc2d19e0b..66c4cd34d4 100644 --- a/html/ajax_mapview.php +++ b/html/ajax_mapview.php @@ -4,4 +4,4 @@ if (isset($_REQUEST['mapView'])) { $_SESSION['mapView'] = $_REQUEST['mapView']; } header('Content-type: text/plain'); -echo $_SESSION['mapView']; \ No newline at end of file +echo $_SESSION['mapView']; diff --git a/html/css/light.css b/html/css/light.css index ab40e3bc13..ac21bcf9c4 100644 --- a/html/css/light.css +++ b/html/css/light.css @@ -87,7 +87,7 @@ 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } } @-ms-keyframes pace-spinner { - 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } + 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes pace-spinner { @@ -95,7 +95,7 @@ 100% { transform: rotate(360deg); transform: rotate(360deg); } } -.device-availability, .service-availability{ +.device-availability, .service-availability { color:#000000; float:left; width:166px; @@ -118,11 +118,11 @@ border:1px solid #FFB733; } -.availability-label{ +.availability-label { float:right;margin:-8px; } -.service-name-label{ +.service-name-label { float:left;margin:-8px; } @@ -157,13 +157,13 @@ .page-availability-title { font-size:26px; - font-weight: bold; + font-weight:bold; line-height:40px; } .page-availability-report-select { font-size:24px; - font-weight: bold; + font-weight:bold; padding-right:10px; } @@ -185,10 +185,10 @@ .widget-availability-host { float:left; - margin-bottom: 10px; + margin-bottom:10px; } .widget-availability-service { float:right; - margin-bottom: 10px; -} \ No newline at end of file + margin-bottom:10px; +} diff --git a/html/includes/common/availability-map.inc.php b/html/includes/common/availability-map.inc.php index decaad5c48..bf82cdc363 100644 --- a/html/includes/common/availability-map.inc.php +++ b/html/includes/common/availability-map.inc.php @@ -54,7 +54,7 @@ if (defined('show_settings')) { if ($mode == 0 || $mode == 2) { // Only show devices if mode is 0 or 2 (Only Devices or both) - $sql = 'SELECT `D`.`hostname`,`D`.`device_id`,`D`.`status`,`D`.`uptime`, `D`.`os` FROM `devices` AS `D`'; + $sql = 'SELECT `D`.`hostname`,`D`.`device_id`,`D`.`status`,`D`.`uptime`, `D`.`os`, `D`.`icon` FROM `devices` AS `D`'; if (is_normal_user() === true) { $sql .= ' , `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = ? AND'; $param = array( @@ -83,8 +83,7 @@ if (defined('show_settings')) { $host_down_count++; } - if($directpage == "yes") - { + if($directpage == "yes") { $deviceIcon = getImage($device); $temp_output[] = ''; @@ -104,7 +103,7 @@ if (defined('show_settings')) { } if ($mode == 1 || $mode == 2) { - $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`device_id`, `D`.`os` from services S, devices D where `S`.`device_id` = `D`.`device_id`;'; + $service_query = 'select `S`.`service_type`, `S`.`service_id`, `S`.`service_desc`, `S`.`service_status`, `D`.`hostname`, `D`.`device_id`, `D`.`os`, `D`.`icon` from services S, devices D where `S`.`device_id` = `D`.`device_id`;'; foreach (dbFetchRows($service_query) as $service) { if ($service['service_status'] == '0') { $serviceLabel = "label-success"; @@ -116,8 +115,7 @@ if (defined('show_settings')) { $service_down_count += 1; } - if($directpage == "yes") - { + if($directpage == "yes") { $deviceIcon = getImage($service); $temp_output[] = ''; @@ -136,8 +134,7 @@ if (defined('show_settings')) { } } - if($directpage == "yes") - { + if($directpage == "yes") { $temp_header[] = '
'; $temp_header[] = 'Availability map for'; $temp_header[] = '
'; $temp_header[] = '
'; - } - if ($mode == 0 || $mode == 2) - { - if($directpage == "yes") - { + if ($mode == 0 || $mode == 2) { + if($directpage == "yes") { $temp_header[] = '
'; $temp_header[] = 'Hosts report:'; $temp_header[] = '
'; @@ -172,13 +166,10 @@ if (defined('show_settings')) { } else { $temp_header[] = '
Total hosts '.$host_up_count.' '.$host_warn_count.' '.$host_down_count.'
'; } - } - if ($mode == 1 || $mode == 2) - { - if($directpage == "yes") - { + if ($mode == 1 || $mode == 2) { + if($directpage == "yes") { $temp_header[] = '
'; $temp_header[] = 'Services report:'; @@ -197,7 +188,7 @@ if (defined('show_settings')) { } $temp_header[] = '
'; - $temp_header[] = '
'; + $temp_header[] = '
'; $common_output = array_merge($temp_header, $temp_output); -} \ No newline at end of file +} diff --git a/html/js/librenms.js b/html/js/librenms.js index 84cc1b6694..8bed8ff000 100644 --- a/html/js/librenms.js +++ b/html/js/librenms.js @@ -254,4 +254,4 @@ $(document).ready(function() { }); } }); -}); \ No newline at end of file +}); From ccc88911f851c855985862d67f072a49baf8eef7 Mon Sep 17 00:00:00 2001 From: crcro Date: Sat, 13 Aug 2016 05:12:05 +0300 Subject: [PATCH 3/7] -fixed select position/size -extra style for text on labels for readibility -PSR-2 style -added classes for all styles --- html/css/dark.css | 106 ++++++++++++++++++ html/css/light.css | 26 +++-- html/css/mono.css | 106 ++++++++++++++++++ html/includes/common/availability-map.inc.php | 37 +++--- 4 files changed, 247 insertions(+), 28 deletions(-) diff --git a/html/css/dark.css b/html/css/dark.css index 980bf42e86..d78912bea2 100644 --- a/html/css/dark.css +++ b/html/css/dark.css @@ -98,3 +98,109 @@ 0% { transform: rotate(0deg); transform: rotate(0deg); } 100% { transform: rotate(360deg); transform: rotate(360deg); } } + +.device-availability, .service-availability{ + color:#000000; + float:left; + width:166px; + height:64px; + margin:10px; + padding:8px; + border-radius:5px; + text-align:center; +} + +.device-availability.up, .service-availability.up { + border:1px solid #5CB85C; +} + +.device-availability.down, .service-availability.down { + border:1px solid #D9534F; +} + +.device-availability.warning { + border:1px solid #FFB733; +} + +.availability-label{ + float:right; + margin:-8px; +} + +.service-name-label{ + float:left; + margin:-8px; +} + +.report-up { + color:#5CB85C; +} + +.report-warning { + color:#FFB733; +} + +.report-down { + color:#D9534F; +} + +.page-availability-report-entry { + text-align:center; + width:50px; +} + +.page-availability-title-left { + width:50%; + float:left; + height:60px; +} + +.page-availability-title-right { + width:50%; + float:left; + text-align:right; +} + +.page-availability-title { + font-size:26px; + font-weight: bold; + line-height:40px; +} + +.page-availability-report-select { + border:none; + font-size:24px; + font-weight:bold; + padding-right:10px; + margin-left:10px; +} + +.page-availability-report-host { + float:right; + text-align:right; + padding-left:10px; +} + +.page-availability-report-service { + float:right; + text-align:right; +} + +.widget-availability { + float:left; + margin:2px; +} + +.widget-availability-host { + float:left; + margin-bottom: 10px; +} + +.widget-availability-service { + float:right; + margin-bottom: 10px; +} + +.label-font-border { + text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; +} \ No newline at end of file diff --git a/html/css/light.css b/html/css/light.css index ac21bcf9c4..c54a5accb1 100644 --- a/html/css/light.css +++ b/html/css/light.css @@ -87,7 +87,7 @@ 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } } @-ms-keyframes pace-spinner { - 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } + 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes pace-spinner { @@ -95,7 +95,7 @@ 100% { transform: rotate(360deg); transform: rotate(360deg); } } -.device-availability, .service-availability { +.device-availability, .service-availability{ color:#000000; float:left; width:166px; @@ -118,12 +118,14 @@ border:1px solid #FFB733; } -.availability-label { - float:right;margin:-8px; +.availability-label{ + float:right; + margin:-8px; } -.service-name-label { - float:left;margin:-8px; +.service-name-label{ + float:left; + margin:-8px; } .report-up { @@ -157,14 +159,16 @@ .page-availability-title { font-size:26px; - font-weight:bold; + font-weight: bold; line-height:40px; } .page-availability-report-select { + border:none; font-size:24px; font-weight:bold; padding-right:10px; + margin-left:10px; } .page-availability-report-host { @@ -185,10 +189,14 @@ .widget-availability-host { float:left; - margin-bottom:10px; + margin-bottom: 10px; } .widget-availability-service { float:right; - margin-bottom:10px; + margin-bottom: 10px; } + +.label-font-border { + text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; +} \ No newline at end of file diff --git a/html/css/mono.css b/html/css/mono.css index e76425cd34..dbeb71e31a 100644 --- a/html/css/mono.css +++ b/html/css/mono.css @@ -98,3 +98,109 @@ 0% { transform: rotate(0deg); transform: rotate(0deg); } 100% { transform: rotate(360deg); transform: rotate(360deg); } } + +.device-availability, .service-availability{ + color:#000000; + float:left; + width:166px; + height:64px; + margin:10px; + padding:8px; + border-radius:5px; + text-align:center; +} + +.device-availability.up, .service-availability.up { + border:1px solid #5CB85C; +} + +.device-availability.down, .service-availability.down { + border:1px solid #D9534F; +} + +.device-availability.warning { + border:1px solid #FFB733; +} + +.availability-label{ + float:right; + margin:-8px; +} + +.service-name-label{ + float:left; + margin:-8px; +} + +.report-up { + color:#5CB85C; +} + +.report-warning { + color:#FFB733; +} + +.report-down { + color:#D9534F; +} + +.page-availability-report-entry { + text-align:center; + width:50px; +} + +.page-availability-title-left { + width:50%; + float:left; + height:60px; +} + +.page-availability-title-right { + width:50%; + float:left; + text-align:right; +} + +.page-availability-title { + font-size:26px; + font-weight: bold; + line-height:40px; +} + +.page-availability-report-select { + border:none; + font-size:24px; + font-weight:bold; + padding-right:10px; + margin-left:10px; +} + +.page-availability-report-host { + float:right; + text-align:right; + padding-left:10px; +} + +.page-availability-report-service { + float:right; + text-align:right; +} + +.widget-availability { + float:left; + margin:2px; +} + +.widget-availability-host { + float:left; + margin-bottom: 10px; +} + +.widget-availability-service { + float:right; + margin-bottom: 10px; +} + +.label-font-border { + text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; +} \ No newline at end of file diff --git a/html/includes/common/availability-map.inc.php b/html/includes/common/availability-map.inc.php index bf82cdc363..e8158c7f16 100644 --- a/html/includes/common/availability-map.inc.php +++ b/html/includes/common/availability-map.inc.php @@ -83,19 +83,19 @@ if (defined('show_settings')) { $host_down_count++; } - if($directpage == "yes") { + if ($directpage == "yes") { $deviceIcon = getImage($device); $temp_output[] = '
'; $temp_output[] = '
'; - $temp_output[] = ''; + $temp_output[] = ''; $temp_output[] = '' . $deviceIcon . '
'; $temp_output[] = '' . $device["hostname"] . ''; $temp_output[] = '
'; } else { $temp_output[] = ''; - $temp_output[] = ''; + $temp_output[] = ''; $temp_output[] = ''; } @@ -115,26 +115,26 @@ if (defined('show_settings')) { $service_down_count += 1; } - if($directpage == "yes") { + if ($directpage == "yes") { $deviceIcon = getImage($service); $temp_output[] = ''; $temp_output[] = '
'; - $temp_output[] = ''; - $temp_output[] = ''; + $temp_output[] = ''; + $temp_output[] = ''; $temp_output[] = '' . $deviceIcon . '
'; $temp_output[] = '' . $service["hostname"] . ''; $temp_output[] = '
'; } else { $temp_output[] = ''; - $temp_output[] = ''; + $temp_output[] = ''; $temp_output[] = ''; } } } - if($directpage == "yes") { + if ($directpage == "yes") { $temp_header[] = '
'; $temp_header[] = 'Availability map for'; $temp_header[] = ''; - $common_output[] = '
'; - $common_output[] = '
'; - $common_output[] = '
'; - $common_output[] = ''; - $common_output[] = '
'; - $common_output[] = ''; - $common_output[] = '
'; - $common_output[] = '
'; - $common_output[] = '
'; - $common_output[] = '
'; - $common_output[] = ''; - $common_output[] = '
'; - $common_output[] = '
'; - $common_output[] = ''; - + $common_output[] = ' +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
'; } else { require_once 'includes/object-cache.inc.php'; $mode = isset($_SESSION["mapView"]) ? $_SESSION["mapView"] : 0; @@ -86,18 +84,19 @@ if (defined('show_settings')) { if ($directpage == "yes") { $deviceIcon = getImage($device); - $temp_output[] = ''; - $temp_output[] = '
'; - $temp_output[] = ''; - $temp_output[] = '' . $deviceIcon . '
'; - $temp_output[] = '' . $device["hostname"] . ''; - $temp_output[] = '
'; + $temp_output[] = ' + +
+ + '.$deviceIcon.'
+ '.$device["hostname"].' +
+
'; } else { - $temp_output[] = ''; - $temp_output[] = ''; - $temp_output[] = ''; + $temp_output[] = ' + + + '; } } @@ -122,77 +121,65 @@ if (defined('show_settings')) { if ($directpage == "yes") { $deviceIcon = getImage($service); - $temp_output[] = ''; - $temp_output[] = '
'; - $temp_output[] = ''; - $temp_output[] = ''; - $temp_output[] = '' . $deviceIcon . '
'; - $temp_output[] = '' . $service["hostname"] . ''; - $temp_output[] = '
'; + $temp_output[] = ' + +
+ + + '.$deviceIcon.'
+ '.$service["hostname"].' +
+
'; } else { - $temp_output[] = ''; - $temp_output[] = ''; - $temp_output[] = ''; + $temp_output[] = ' + + + '; } } } if ($directpage == "yes") { - $temp_header[] = '
'; - $temp_header[] = 'Availability map for'; - $temp_header[] = '
'; - $temp_header[] = '
'; + $temp_header[] = ' +
+ Availability map for + +
+
'; } - if ($mode == 0 || $mode == 2) { if ($directpage == "yes") { - $temp_header[] = '
'; - $temp_header[] = 'Hosts report:'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
' . $host_up_count . '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
' . $host_warn_count . '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
' . $host_down_count . '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; + $headerClass = 'page-availability-report-host'; } else { - $temp_header[] = '
Total hosts '.$host_up_count.' '.$host_warn_count.' '.$host_down_count.'
'; + $headerClass = 'widget-availability-host'; } + $temp_header[] = ' +
+ Total hosts + + + +
'; } if ($mode == 1 || $mode == 2) { if ($directpage == "yes") { - $temp_header[] = '
'; - $temp_header[] = 'Services report:'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
' . $service_up_count . '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
' . $service_warn_count . '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; - $temp_header[] = '
' . $service_down_count . '
'; - $temp_header[] = '
'; - $temp_header[] = '
'; + $headerClass = 'page-availability-report-service'; } else { - $temp_header[] = '
Total services '.$service_up_count.' '.$service_warn_count.' '.$service_down_count.'
'; + $headerClass = 'widget-availability-service'; } + $temp_header[] = ' +
+ Total services + + + +
'; } $temp_header[] = '
';