From 4ec6b4e053e3ebad4dc0ffcf70bc2784e6c3b013 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 26 Sep 2017 11:53:57 +0200 Subject: [PATCH] add new select to setup for TIP --- .../godmode/setup/setup_visuals.php | 20 +++++++++++ pandora_console/include/functions_config.php | 4 +++ .../agentes/interface_traffic_graph_win.php | 13 ++++++- .../operation/agentes/stat_win.php | 36 +++++++++++++++++-- 4 files changed, 70 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index a8ff68d74c..42b33ffa57 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -535,6 +535,26 @@ $table_chars->data[$row][0] .= ui_print_help_tip(__('Show percentile 95 in graph $table_chars->data[$row][1] = html_print_input_text ('percentil', $config['percentil'], '', 20, 20, true); $row++; +$table_chars->data[$row][0] = __('Graph TIP view:'); +$table_chars->data[$row][0] .= ui_print_help_tip(__('This option may cause performance issues'), true); + +$options_full_escale = array(); +$options_full_escale[0] = __('None'); +$options_full_escale[1] = __('All'); +$options_full_escale[2] = __('On Boolean graphs'); + +$table_chars->data[$row][1] = html_print_select($options_full_escale, 'full_scale_option', $config["full_scale_option"], '', '', 0, true, false, false); +$row++; + +/* + $table_font->data[$row][0] = __('Font path'); +$fonts = load_fonts(); +$table_font->data[$row][1] = html_print_select($fonts, 'fontpath', + io_safe_output($config["fontpath"]), '', '', 0, true); + +$row++; +*/ + echo "
"; echo "" . __('Charts configuration') . ""; html_print_table ($table_chars); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 1a70f8d41d..aeb7634424 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -569,6 +569,10 @@ function config_update_config () { } if (!config_update_value ('percentil', (int) get_parameter('percentil', 0))) $error_update[] = __('Default percentil'); + + if (!config_update_value ('full_scale_option', (int) get_parameter('full_scale_option', 0))) + $error_update[] = __('Default full scale (TIP)'); + if (!config_update_value ('classic_menu', (bool) get_parameter('classic_menu', false))) $error_update[] = __('Classic menu mode'); diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 0e1c6ae241..9a29948c89 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -150,8 +150,19 @@ $interface_traffic_modules = array( $zoom = (int) get_parameter ("zoom", 1); $baseline = get_parameter ("baseline", 0); $show_percentil = get_parameter ("show_percentil", 0); - $fullscale = get_parameter("fullscale", 0); + $fullscale = get_parameter("fullscale"); + if(!isset($_GET["fullscale_sent"]) ){ + if(!isset($config['full_scale_option']) || + $config['full_scale_option'] == 0 || + $config['full_scale_option'] == 2 ){ + $fullscale = 0; + } + else{ + $fullscale = 1; + } + } + if ($zoom > 1) { $height = $height * ($zoom / 2.1); $width = $width * ($zoom / 1.4); diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 5199f58506..bf8ce3b044 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -93,6 +93,15 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); period_select_init(periodSelectId); }; + function fullscal_other() { + if ($('#checkbox-fullscale').is(":checked") == true) { + $("#hidden-fullscale_other").val(1); + } + else { + $("#hidden-fullscale_other").val(0); + } + } + function show_others() { if ($('#checkbox-avg_only').is(":checked") == true) { $("#hidden-show_other").val(1); @@ -101,6 +110,8 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $("#hidden-show_other").val(0); } } + + //--> @@ -154,6 +165,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); if ($period == "") { $period = get_parameter ("period_select", SECONDS_1DAY); } + $id = get_parameter ("id", 0); $width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH); $height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT); @@ -170,7 +182,26 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $time_compare_separated = get_parameter ("time_compare_separated", 0); $time_compare_overlapped = get_parameter ("time_compare_overlapped", 0); $unknown_graph = get_parameter_checkbox ("unknown_graph", 1); - $fullscale = get_parameter ("fullscale", 0); + + if(!isset($config['full_scale_option']) || $config['full_scale_option'] == 0){ + $fullscale = 0; + } + elseif($config['full_scale_option'] == 1){ + $fullscale = 1; + } + elseif($config['full_scale_option'] == 2){ + if($graph_type == 'boolean'){ + $fullscale = 1; + }else{ + $fullscale = 0; + } + } + + $fullscale_other = get_parameter ("fullscale_other", $fullscale); + + if(isset($fullscale_other)){ + $fullscale = $fullscale_other; + } // To avoid the horizontal overflow $width -= 20; @@ -405,7 +436,8 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $data = array(); $data[0] = __('Show full scale graph (TIP)'); - $data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true); + $data[1] = html_print_checkbox ("fullscale", 1, (bool) $fullscale, true, false,'fullscal_other()'); + $data[1] .= html_print_input_hidden('fullscale_other', 0, true); $table->data[] = $data; $table->rowclass[] = '';