add new select to setup for TIP

This commit is contained in:
daniel 2017-09-26 11:53:57 +02:00
parent 5ab5e04630
commit 4ec6b4e053
4 changed files with 70 additions and 3 deletions

View File

@ -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); $table_chars->data[$row][1] = html_print_input_text ('percentil', $config['percentil'], '', 20, 20, true);
$row++; $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 "<fieldset>"; echo "<fieldset>";
echo "<legend>" . __('Charts configuration') . "</legend>"; echo "<legend>" . __('Charts configuration') . "</legend>";
html_print_table ($table_chars); html_print_table ($table_chars);

View File

@ -569,6 +569,10 @@ function config_update_config () {
} }
if (!config_update_value ('percentil', (int) get_parameter('percentil', 0))) if (!config_update_value ('percentil', (int) get_parameter('percentil', 0)))
$error_update[] = __('Default percentil'); $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))) if (!config_update_value ('classic_menu', (bool) get_parameter('classic_menu', false)))
$error_update[] = __('Classic menu mode'); $error_update[] = __('Classic menu mode');

View File

@ -150,8 +150,19 @@ $interface_traffic_modules = array(
$zoom = (int) get_parameter ("zoom", 1); $zoom = (int) get_parameter ("zoom", 1);
$baseline = get_parameter ("baseline", 0); $baseline = get_parameter ("baseline", 0);
$show_percentil = get_parameter ("show_percentil", 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) { if ($zoom > 1) {
$height = $height * ($zoom / 2.1); $height = $height * ($zoom / 2.1);
$width = $width * ($zoom / 1.4); $width = $width * ($zoom / 1.4);

View File

@ -93,6 +93,15 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
period_select_init(periodSelectId); 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() { function show_others() {
if ($('#checkbox-avg_only').is(":checked") == true) { if ($('#checkbox-avg_only').is(":checked") == true) {
$("#hidden-show_other").val(1); $("#hidden-show_other").val(1);
@ -101,6 +110,8 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$("#hidden-show_other").val(0); $("#hidden-show_other").val(0);
} }
} }
//--> //-->
</script> </script>
</head> </head>
@ -154,6 +165,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
if ($period == "") { if ($period == "") {
$period = get_parameter ("period_select", SECONDS_1DAY); $period = get_parameter ("period_select", SECONDS_1DAY);
} }
$id = get_parameter ("id", 0); $id = get_parameter ("id", 0);
$width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH); $width = get_parameter ("width", STATWIN_DEFAULT_CHART_WIDTH);
$height = get_parameter ("height", STATWIN_DEFAULT_CHART_HEIGHT); $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_separated = get_parameter ("time_compare_separated", 0);
$time_compare_overlapped = get_parameter ("time_compare_overlapped", 0); $time_compare_overlapped = get_parameter ("time_compare_overlapped", 0);
$unknown_graph = get_parameter_checkbox ("unknown_graph", 1); $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 // To avoid the horizontal overflow
$width -= 20; $width -= 20;
@ -405,7 +436,8 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
$data = array(); $data = array();
$data[0] = __('Show full scale graph (TIP)'); $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->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';