From b4e7b4d5564a1a18adf5c6b27f6afb07eddeae61 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 9 Aug 2010 10:19:14 +0000 Subject: [PATCH] 2010-08-09 Sergio Martin * extensions/module_groups.php: Fixed the status colors of the modules by groups matrix git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3110 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++ pandora_console/extensions/module_groups.php | 38 ++++++++++++-------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6777773d9c..19343463be 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2010-08-09 Sergio Martin + + * extensions/module_groups.php: Fixed the status colors of + the modules by groups matrix + 2010-08-09 Sergio Martin * extensions/agents_modules.php diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 8dd914d190..4e7518529a 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -26,7 +26,9 @@ */ function mainModuleGroups() { global $config; //the useful global var of Pandora Console, it has many data can you use - + + require_once ('include/functions_reporting.php'); + //The big query $sql = "select COUNT(id_agente) AS count, estado FROM tagente_estado @@ -85,21 +87,29 @@ function mainModuleGroups() { $color = 'transparent'; //Defaut color for cell $font_color = '#000000'; //Default font color for cell if ($count == 0) { - $color = '#babdb6'; //Grey when the cell for this model group and agent group hasn't modules. + $color = '#eeeeee'; //Soft grey when the cell for this model group and agent group hasn't modules. $alinkStart = ''; $alinkEnd = ''; } - else { - if (array_key_exists(0,$states) && (count($states) == 1)) - $color = '#8ae234'; //Green when the cell for this model group and agent has OK state all modules. - else { - if (array_key_exists(1,$states)) { + else { + // TODO: ADD Alerts fired status + /*if (array_key_exists(4,$states)) { + $color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired. + }*/ + if (array_key_exists(1,$states)) { $color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state. $font_color = '#ffffff'; - } - else + } + elseif (array_key_exists(2,$states)) { $color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state. } + elseif (array_key_exists(3,$states)) { + $color = '#babdb6'; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state. + } + elseif (array_key_exists(0,$states)) { + $color = '#8ae234'; //Green when the cell for this model group and agent has OK state all modules. + } + $alinkStart = '' . '
  •  
    ' . - __("Yellow cell when the module group and agent have at least one in warning state and the others in green state.") . + __("Yellow cell when the module group and agent have at least one in warning state and the others in grey or green state.") . + '
  • ' . + '
  • +
     
    ' . + __("Grey cell when the module group and agent have at least one in unknown state and the others in green state.") . '
  • ' . '
  •  
    ' . __("Green cell when the module group and agent have all modules in OK state.") . '
  • ' . - '
  • -
     
    ' . - __("Grey cell when the module group and agent don't have any modules.") . - '
  • ' . "" . "

    "; }