diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index cfbf070a6a..7addef057f 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -30,6 +30,33 @@ require_once 'include/functions_notifications.php'; $notifications_numbers['last_id'] ).''; + // ======= Servers List =============================================== + $servers_list = '
'; + $servers = []; + $servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver'); + if ($servers['all'] != 0) { + $servers['up'] = (int) servers_check_status(); + $servers['down'] = ($servers['all'] - $servers['up']); + if ($servers['up'] == 0) { + // All Servers down or no servers at all. + $servers_check_img = html_print_image('images/header_down_gray.png', true, ['alt' => 'cross', 'class' => 'bot', 'title' => __('All systems').': '.__('Down')]); + } else if ($servers['down'] != 0) { + // Some servers down. + $servers_check_img = html_print_image('images/header_warning_gray.png', true, ['alt' => 'error', 'class' => 'bot', 'title' => $servers['down'].' '.__('servers down')]); + } else { + // All servers up. + $servers_check_img = html_print_image('images/header_ready_gray.png', true, ['alt' => 'ok', 'class' => 'bot', 'title' => __('All systems').': '.__('Ready')]); + } + + unset($servers); + // Since this is the header, we don't like to trickle down variables. + $servers_check_img_link = ''; + $servers_check_img_link .= $servers_check_img; + $servers_check_img_link .= ''; + }; + $servers_list .= $servers_check_img_link.'
'; + + // ======= Alerts =============================================== $check_minor_release_available = false; @@ -48,7 +75,7 @@ require_once 'include/functions_notifications.php'; } - // Chat messages + // Chat messages. $header_chat = "