From a316419afae3d04d359982be70809c5842494457 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Wed, 22 Jul 2015 11:49:00 +0200 Subject: [PATCH] Add new options when render proc is active. Tiquet: #2503 --- pandora_console/godmode/setup/setup_visuals.php | 11 ++++++++++- pandora_console/include/ajax/module.php | 4 ++-- pandora_console/include/functions_config.php | 13 ++++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 46b0396a63..1c858d7e06 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -81,7 +81,7 @@ $table_behaviour->data[$row][1] = html_print_checkbox('paginate_module', 1, $config['paginate_module'], true); $row++; -$table_behaviour->data[$row][0] = __('Display proc modules in binary format (OK/FAIL).'); +$table_behaviour->data[$row][0] = __('Display data of proc modules in other format'); $table_behaviour->data[$row][1] = __('Yes') . ' ' . html_print_radio_button ('render_proc', 1, '', $config["render_proc"], true) . @@ -90,6 +90,15 @@ $table_behaviour->data[$row][1] .= __('No') . ' ' . html_print_radio_button ('render_proc', 0, '', $config["render_proc"], true); $row++; + +$table_behaviour->data[$row][0] = __('Display text proc modules have state is ok'); +$table_behaviour->data[$row][1] = html_print_input_text ('render_proc_ok', $config["render_proc_ok"], '', 25, 25, true); +$row++; + +$table_behaviour->data[$row][0] = __('Display text when proc modules have state critical'); +$table_behaviour->data[$row][1] = html_print_input_text ('render_proc_fail', $config["render_proc_fail"], '', 25, 25, true); +$row++; + echo "
"; echo "" . __('Behaviour configuration') . ""; html_print_table ($table_behaviour); diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 74b828036a..a72b1456a2 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -903,9 +903,9 @@ if ($list_modules) { case 21: case 31: if ($module["datos"]>=1) - $salida ='OK'; + $salida = $config["render_proc_ok"]; else - $salida = 'FAIL'; + $salida = $config["render_proc_fail"]; break; default: $salida = format_numeric($module["datos"]); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 0c982d35f8..71c520bb20 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -468,7 +468,11 @@ function config_update_config () { if (!config_update_value ('type_module_charts', (string) get_parameter('type_module_charts', 'area'))) $error_update[] = __('Default type of module charts.'); if (!config_update_value ('render_proc', (bool) get_parameter('render_proc', false))) - $error_update[] = __('Display proc modules in binary format (OK/FAIL)'); + $error_update[] = __('Display dara of proc modules in other format'); + if (!config_update_value ('render_proc_ok', (string) get_parameter('render_proc_ok', __('Ok') ))) + $error_update[] = __('Display text proc modules have state is ok'); + if (!config_update_value ('render_proc_fail', (string) get_parameter('render_proc_fail', __('Fail') ))) + $error_update[] = __('Display text when proc modules have state critical'); @@ -1296,6 +1300,13 @@ function config_process_config () { config_update_value ('render_proc', 0); } + if (!isset($config["render_proc_ok"])) { + config_update_value ('render_proc_ok', __('Ok') ); + } + if (!isset($config["render_proc_fail"])) { + config_update_value ('render_proc_fail', __('Fail') ); + } + if (!isset($config['command_snapshot'])) { config_update_value ('command_snapshot', 1); }