Merge branch '1827-Graficas_TIP_eje_x_no_mantiene_ratio' into 'develop'
1827 graficas tip eje x no mantiene ratio See merge request artica/pandorafms!1534
This commit is contained in:
commit
0e199a377e
|
@ -36,43 +36,35 @@ if (is_ajax()){
|
|||
$add_custom = (bool) get_parameter('add_custom',0);
|
||||
$add_dynamic = (bool) get_parameter('add_dynamic',0);
|
||||
$id_container2 = get_parameter('id_container',0);
|
||||
|
||||
|
||||
if($add_single) {
|
||||
$id_agent = get_parameter('id_agent');
|
||||
$id_agent_module = get_parameter('id_agent_module');
|
||||
$time_lapse = get_parameter('time_lapse');
|
||||
$only_avg = get_parameter('only_avg');
|
||||
$simple_type_graph = get_parameter('simple_type_graph');
|
||||
$fullscale = get_parameter('fullscale');
|
||||
|
||||
if($only_avg != 'false'){
|
||||
$only_avg = 1;
|
||||
} else{
|
||||
$only_avg = 0;
|
||||
}
|
||||
|
||||
|
||||
if($fullscale != 'false'){
|
||||
$fullscale = 1;
|
||||
}
|
||||
else{
|
||||
$fullscale = 0;
|
||||
}
|
||||
|
||||
|
||||
$values = array(
|
||||
'id_container' => $id_container2,
|
||||
'type' => "simple_graph",
|
||||
'id_agent' => $id_agent,
|
||||
'id_agent_module' => $id_agent_module,
|
||||
'time_lapse' => $time_lapse,
|
||||
'only_average' => $only_avg,
|
||||
'type_graph' => $simple_type_graph,
|
||||
'fullscale' => $fullscale);
|
||||
|
||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||
return;
|
||||
}
|
||||
|
||||
if($add_custom) {
|
||||
|
||||
if($add_custom) {
|
||||
$time_lapse = get_parameter('time_lapse');
|
||||
$id_custom = get_parameter('id_custom');
|
||||
$fullscale = get_parameter('fullscale');
|
||||
|
@ -93,8 +85,8 @@ if (is_ajax()){
|
|||
|
||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($add_dynamic) {
|
||||
$time_lapse = get_parameter('time_lapse');
|
||||
$group = get_parameter('group',0);
|
||||
|
@ -102,34 +94,29 @@ if (is_ajax()){
|
|||
$agent_alias = get_parameter('agent_alias','');
|
||||
$module_name = get_parameter('module_name','');
|
||||
$tag = get_parameter('tag',0);
|
||||
$only_avg = get_parameter('only_avg');
|
||||
|
||||
$simple_type_graph2 = get_parameter('simple_type_graph2');
|
||||
$fullscale = get_parameter('fullscale');
|
||||
if($only_avg != 'false') {
|
||||
$only_avg = 1;
|
||||
} else {
|
||||
$only_avg = 0;
|
||||
}
|
||||
|
||||
|
||||
if($fullscale != 'false'){
|
||||
$fullscale = 1;
|
||||
}
|
||||
else{
|
||||
$fullscale = 0;
|
||||
}
|
||||
|
||||
|
||||
$values = array(
|
||||
'id_container' => $id_container2,
|
||||
'type' => "dynamic_graph",
|
||||
'time_lapse' => $time_lapse,
|
||||
'id_group' => $group,
|
||||
'id_module_group' => $module_group,
|
||||
'id_container' => $id_container2,
|
||||
'type' => "dynamic_graph",
|
||||
'time_lapse' => $time_lapse,
|
||||
'id_group' => $group,
|
||||
'id_module_group' => $module_group,
|
||||
'agent' => $agent_alias,
|
||||
'module' => $module_name,
|
||||
'id_tag' => $tag,
|
||||
'only_average' => $only_avg,
|
||||
'module' => $module_name,
|
||||
'id_tag' => $tag,
|
||||
'type_graph' => $simple_type_graph2,
|
||||
'fullscale' => $fullscale);
|
||||
'fullscale' => $fullscale
|
||||
);
|
||||
|
||||
$id_item = db_process_sql_insert('tcontainer_item', $values);
|
||||
return;
|
||||
|
@ -356,25 +343,16 @@ if($edit_container){
|
|||
}
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "</tr>";
|
||||
|
||||
$single_table .= "<tr id='row_only_avg' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Only average');
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "<td>";
|
||||
$single_table .= html_print_checkbox('only_avg', 1, true,true);
|
||||
$single_table .= "</td>";
|
||||
|
||||
$single_table .= "<tr id='row_type_graphs' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Type of graph');
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "<td>";
|
||||
$single_table .= html_print_select ($type_graphs, 'simple_type_graph', "","","",0,true);
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "</tr>";
|
||||
|
||||
$single_table .= "<tr id='row_only_avg' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Type of graph');
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "<td>";
|
||||
$single_table .= html_print_select ($type_graphs, 'simple_type_graph', "","","",0,true);
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "</tr>";
|
||||
|
||||
|
||||
$single_table .= "<tr id='row_fullscale' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Show full scale graph (TIP)') . ui_print_help_tip('This option may cause performance issues', true);
|
||||
|
@ -383,7 +361,7 @@ if($edit_container){
|
|||
$single_table .= html_print_checkbox('fullscale', 1, false,true);
|
||||
$single_table .= "</td>";
|
||||
$single_table .= "</tr>";
|
||||
|
||||
|
||||
$single_table .= "<tr>";
|
||||
$single_table .= "<td >";
|
||||
$single_table .= "</td>";
|
||||
|
@ -513,12 +491,6 @@ if($edit_container){
|
|||
$data[1] = html_print_select ($type_graphs, 'simple_type_graph2', "","","",0,true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Only average');
|
||||
$data[1] = html_print_checkbox('only_avg_2', 1, false,true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Show full scale graph (TIP)') .
|
||||
|
@ -633,33 +605,31 @@ echo html_print_input_hidden('id_agent', 0);
|
|||
$(document).ready (function () {
|
||||
$("input[name=add_single]").click (function () {
|
||||
var id_agent_module = $("#id_agent_module").val();
|
||||
if(id_agent_module !== '0'){
|
||||
var id_agent = $("#hidden-id_agent").attr('value');
|
||||
var time_lapse = $("#hidden-period_single").attr('value');
|
||||
var simple_type_graph = $("#simple_type_graph option:selected").attr('value');
|
||||
var only_avg = $("#checkbox-only_avg").prop("checked");
|
||||
var fullscale = $("#checkbox-fullscale").prop("checked");
|
||||
var id_container = <?php echo $id_container; ?>;
|
||||
jQuery.post ("ajax.php",
|
||||
{"page" : "godmode/reporting/create_container",
|
||||
"add_single" : 1,
|
||||
"id_agent" : id_agent,
|
||||
"id_agent_module" : id_agent_module,
|
||||
"time_lapse" : time_lapse,
|
||||
"simple_type_graph": simple_type_graph,
|
||||
"only_avg" : only_avg,
|
||||
"fullscale" : fullscale,
|
||||
"id_container" : id_container,
|
||||
},
|
||||
function (data, status) {
|
||||
var url = location.href.replace('&update_container=1', "");
|
||||
url = url.replace('&delete_item=1', "");
|
||||
location.href = url.replace('&add_container=1', "&id="+id_container);
|
||||
}
|
||||
);
|
||||
}
|
||||
if(id_agent_module !== '0'){
|
||||
var id_agent = $("#hidden-id_agent").attr('value');
|
||||
var time_lapse = $("#hidden-period_single").attr('value');
|
||||
var simple_type_graph = $("#simple_type_graph option:selected").attr('value');
|
||||
var fullscale = $("#checkbox-fullscale").prop("checked");
|
||||
var id_container = <?php echo $id_container; ?>;
|
||||
jQuery.post (
|
||||
"ajax.php",
|
||||
{"page" : "godmode/reporting/create_container",
|
||||
"add_single" : 1,
|
||||
"id_agent" : id_agent,
|
||||
"id_agent_module" : id_agent_module,
|
||||
"time_lapse" : time_lapse,
|
||||
"simple_type_graph": simple_type_graph,
|
||||
"fullscale" : fullscale,
|
||||
"id_container" : id_container},
|
||||
function (data, status) {
|
||||
var url = location.href.replace('&update_container=1', "");
|
||||
url = url.replace('&delete_item=1', "");
|
||||
location.href = url.replace('&add_container=1', "&id="+id_container);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$("input[name=add_custom]").click (function () {
|
||||
var id_custom = $("#id_custom_graph").val();
|
||||
var fullscale = $("#checkbox-fullscale_2").prop("checked");
|
||||
|
@ -691,7 +661,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||
var module_group = $("#combo_modulegroup").val();
|
||||
var simple_type_graph2 = $("#simple_type_graph2 option:selected").attr('value');
|
||||
var tag = $("#tag").val();
|
||||
var only_avg = $("#checkbox-only_avg_2").prop("checked");
|
||||
|
||||
var id_container = <?php echo $id_container; ?>;
|
||||
var fullscale = $("#checkbox-fullscale_3").prop("checked");
|
||||
jQuery.post ("ajax.php",
|
||||
|
@ -705,8 +675,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||
"simple_type_graph2": simple_type_graph2,
|
||||
"tag" : tag,
|
||||
"id_container" : id_container,
|
||||
"only_avg" : only_avg,
|
||||
"fullscale" : fullscale,
|
||||
"fullscale" : fullscale
|
||||
},
|
||||
function (data, status) {
|
||||
var url = location.href.replace('&update_container=1', "");
|
||||
|
|
|
@ -93,7 +93,6 @@ $id_agents = '';
|
|||
$inventory_modules = array();
|
||||
$date = null;
|
||||
// Only avg is selected by default for the simple graphs
|
||||
$only_avg = true;
|
||||
$fullscale = false;
|
||||
$percentil = false;
|
||||
$time_compare_overlapped = false;
|
||||
|
@ -215,7 +214,6 @@ switch ($action) {
|
|||
$log_number = empty($es['log_number']) ? $log_number : $es['log_number'];
|
||||
break;
|
||||
case 'simple_graph':
|
||||
$only_avg = isset($style['only_avg']) ? (bool) $style['only_avg'] : true;
|
||||
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
|
||||
$percentil = isset($style['percentil']) ? $config['percentil'] : 0;
|
||||
// The break hasn't be forgotten.
|
||||
|
@ -1368,7 +1366,7 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr id="row_time_compare_overlapped" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Time compare (Overlapped)');?></td>
|
||||
<td>
|
||||
|
@ -1377,20 +1375,18 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_only_avg" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Only average');?></td>
|
||||
<td><?php html_print_checkbox('only_avg', 1, $only_avg);?></td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_fullscale" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Full resolution graph (TIP)').
|
||||
ui_print_help_tip(__('This option may cause performance issues.'), true);?></td>
|
||||
<td><?php html_print_checkbox('fullscale', 1, $fullscale);?></td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_percentil" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Percentil');?></td>
|
||||
<td><?php html_print_checkbox('percentil', 1, $percentil);?></td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_exception_condition_value" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Value'); ?></td>
|
||||
<td style="">
|
||||
|
@ -1400,6 +1396,7 @@ You can of course remove the warnings, that's why we include the source and do n
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_exception_condition" style="" class="datos">
|
||||
<td style="font-weight:bold;"><?php echo __('Condition');?></td>
|
||||
<td>
|
||||
|
@ -2825,7 +2822,6 @@ function chooseType() {
|
|||
$("#row_show_address_agent").hide();
|
||||
$("#row_show_graph").hide();
|
||||
$("#row_max_min_avg").hide();
|
||||
$("#row_only_avg").hide();
|
||||
$("#row_fullscale").hide();
|
||||
$("#row_time_compare_overlapped").hide();
|
||||
$("#row_quantity").hide();
|
||||
|
@ -2920,7 +2916,6 @@ function chooseType() {
|
|||
|
||||
case 'simple_graph':
|
||||
$("#row_time_compare_overlapped").show();
|
||||
// $("#row_only_avg").show();
|
||||
$("#row_fullscale").show();
|
||||
if ($("#checkbox-percentil").prop("checked"))
|
||||
$("#row_percentil").show();
|
||||
|
|
|
@ -1232,7 +1232,6 @@ switch ($action) {
|
|||
case 'simple_graph':
|
||||
// Warning. We are using this column to hold this value to avoid
|
||||
// the modification of the database for compatibility reasons.
|
||||
$style['only_avg'] = (int) get_parameter('only_avg');
|
||||
$style['percentil'] = (int) get_parameter('percentil');
|
||||
$style['fullscale'] = (int) get_parameter('fullscale');
|
||||
if ($label != '')
|
||||
|
@ -1592,7 +1591,6 @@ switch ($action) {
|
|||
case 'simple_graph':
|
||||
// Warning. We are using this column to hold this value to avoid
|
||||
// the modification of the database for compatibility reasons.
|
||||
$style['only_avg'] = (int) get_parameter('only_avg');
|
||||
$style['percentil'] = (int) get_parameter('percentil');
|
||||
$style['fullscale'] = (int) get_parameter('fullscale');
|
||||
if ($label != '')
|
||||
|
|
|
@ -580,15 +580,15 @@ $table_chars->style[0] = 'font-weight: bold;';
|
|||
$table_chars->size[0] = '50%';
|
||||
$table_chars->data = array ();
|
||||
|
||||
$table_chars->data[$row][0] = __('Graph color (min)');
|
||||
$table_chars->data[$row][0] = __('Graph color #1');
|
||||
$table_chars->data[$row][1] = html_print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
|
||||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Graph color (avg)');
|
||||
$table_chars->data[$row][0] = __('Graph color #2');
|
||||
$table_chars->data[$row][1] = html_print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
|
||||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Graph color (max)');
|
||||
$table_chars->data[$row][0] = __('Graph color #3');
|
||||
$table_chars->data[$row][1] = html_print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
|
||||
$row++;
|
||||
|
||||
|
@ -655,15 +655,6 @@ $table_chars->data[$row][1] = __('Yes').' '.html_print_radio_button ('round
|
|||
$table_chars->data[$row][1] .= __('No').' '.html_print_radio_button ('round_corner', 0, '', $config["round_corner"], true);
|
||||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Interactive charts') .
|
||||
ui_print_help_tip(__('Whether to use Javascript or static PNG graphs'), true);
|
||||
$table_chars->data[$row][1] = __('Yes').' ' .
|
||||
html_print_radio_button ('flash_charts', 1, '', $config["global_flash_charts"], true).' ';
|
||||
$table_chars->data[$row][1] .= __('No').' ' .
|
||||
html_print_radio_button ('flash_charts', 0, '', $config["global_flash_charts"], true);
|
||||
$row++;
|
||||
|
||||
|
||||
$table_chars->data[$row][0] = __('Type of module charts');
|
||||
$table_chars->data[$row][1] = __('Area').' ' .
|
||||
html_print_radio_button ('type_module_charts', 'area', '',
|
||||
|
@ -682,14 +673,6 @@ $table_chars->data[$row][1] .= __('Line').' ' .
|
|||
$config["type_interface_charts"] != 'area', true);
|
||||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Show only average');
|
||||
$table_chars->data[$row][0] .= ui_print_help_tip(__('Hide Max and Min values in graphs'), true);
|
||||
$table_chars->data[$row][1] = __('Yes').' ' .
|
||||
html_print_radio_button ('only_average', 1, '', $config["only_average"], true).' ';
|
||||
$table_chars->data[$row][1] .= __('No').' ' .
|
||||
html_print_radio_button ('only_average', 0, '', $config["only_average"], true);
|
||||
$row++;
|
||||
|
||||
$table_chars->data[$row][0] = __('Percentile');
|
||||
$table_chars->data[$row][0] .= ui_print_help_tip(__('Show percentile 95 in graphs'), true);
|
||||
$table_chars->data[$row][1] = html_print_input_text ('percentil', $config['percentil'], '', 20, 20, true);
|
||||
|
|
|
@ -88,7 +88,6 @@ if ($print_sparse_graph) {
|
|||
'title' => (string) get_parameter('title'),
|
||||
'unit_name' => (string) get_parameter('unit_name'),
|
||||
'show_alerts' => (bool) get_parameter('show_alerts'),
|
||||
'avg_only' => (int) get_parameter('avg_only'),
|
||||
'pure' => (bool) get_parameter('pure'),
|
||||
'date' => (int) get_parameter('date', time()),
|
||||
'unit' => (string) get_parameter('unit'),
|
||||
|
@ -177,7 +176,6 @@ if ($get_graphs){
|
|||
$params =array(
|
||||
'agent_module_id' => $value['id_agent_module'],
|
||||
'period' => $value['time_lapse'],
|
||||
'avg_only' => $value['only_average'],
|
||||
'homeurl' => ui_get_full_url(false, false, false, false),
|
||||
'type_graph' => $type_graph,
|
||||
'fullscale' => $value['fullscale']
|
||||
|
@ -271,7 +269,6 @@ if ($get_graphs){
|
|||
$params =array(
|
||||
'agent_module_id' => $value2['id_agente_modulo'],
|
||||
'period' => $value['time_lapse'],
|
||||
'avg_only' => $value['only_average'],
|
||||
'homeurl' => ui_get_full_url(false, false, false, false),
|
||||
'type_graph' => $type_graph,
|
||||
'fullscale' => $value['fullscale']
|
||||
|
|
|
@ -1668,7 +1668,6 @@ class Tree {
|
|||
);
|
||||
|
||||
if (is_metaconsole() && !empty($server)) {
|
||||
$graph_params["avg_only"] = 1;
|
||||
// Set the server id
|
||||
$graph_params["server"] = $module['serverID'];
|
||||
}
|
||||
|
|
|
@ -199,8 +199,6 @@ else {
|
|||
|
||||
// Save the global values
|
||||
$config["global_block_size"] = $config["block_size"];
|
||||
$config["global_flash_charts"] = $config["flash_charts"];
|
||||
|
||||
|
||||
if (isset ($config['id_user'])) {
|
||||
config_user_set_custom_config();
|
||||
|
|
|
@ -2895,76 +2895,73 @@ function color_graph_array(){
|
|||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
|
||||
//XXX Hablar con Sancho del tema de los slices
|
||||
/*
|
||||
$color_series[1] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color2'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[2] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color3'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
*/
|
||||
|
||||
$color_series[1] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color4'],
|
||||
'color' => $config['graph_color2'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[2] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color5'],
|
||||
'color' => $config['graph_color3'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
|
||||
$color_series[3] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color6'],
|
||||
'color' => $config['graph_color4'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[4] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color7'],
|
||||
'color' => $config['graph_color5'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[5] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color8'],
|
||||
'color' => $config['graph_color6'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[6] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color9'],
|
||||
'color' => $config['graph_color7'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[7] = array(
|
||||
'border' => '#000000',
|
||||
'color' => $config['graph_color10'],
|
||||
'color' => $config['graph_color8'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[8] = array(
|
||||
'border' => '#000000',
|
||||
'color' => COL_GRAPH9,
|
||||
'color' => $config['graph_color9'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[9] = array(
|
||||
'border' => '#000000',
|
||||
'color' => COL_GRAPH10,
|
||||
'color' => $config['graph_color10'],
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[10] = array(
|
||||
'border' => '#000000',
|
||||
'color' => COL_GRAPH11,
|
||||
'color' => COL_GRAPH9,
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[11] = array(
|
||||
'border' => '#000000',
|
||||
'color' => COL_GRAPH12,
|
||||
'color' => COL_GRAPH10,
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[12] = array(
|
||||
'border' => '#000000',
|
||||
'color' => COL_GRAPH11,
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[13] = array(
|
||||
'border' => '#000000',
|
||||
'color' => COL_GRAPH12,
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
);
|
||||
$color_series[14] = array(
|
||||
'border' => '#000000',
|
||||
'color' => COL_GRAPH13,
|
||||
'alpha' => CHART_DEFAULT_ALPHA
|
||||
|
|
|
@ -7012,7 +7012,6 @@ function api_get_graph_module_data($id, $thrash1, $other, $thrash2) {
|
|||
$draw_events = 0;
|
||||
$zoom = 1;
|
||||
$label = $other['data'][3];
|
||||
$avg_only = 0;
|
||||
$start_date = $other['data'][4];
|
||||
$date = strtotime($start_date);
|
||||
|
||||
|
|
|
@ -498,9 +498,7 @@ function config_update_config () {
|
|||
$error_update[] = __('Font path');
|
||||
if (!config_update_value ('font_size', get_parameter('font_size')))
|
||||
$error_update[] = __('Font size');
|
||||
if (!config_update_value ('flash_charts', (bool) get_parameter ('flash_charts')))
|
||||
$error_update[] = __('Interactive charts');
|
||||
|
||||
|
||||
if (!config_update_value ('custom_favicon', (string) get_parameter ('custom_favicon')))
|
||||
$error_update[] = __('Custom favicon');
|
||||
if (!config_update_value ('custom_logo', (string) get_parameter ('custom_logo')))
|
||||
|
@ -610,8 +608,6 @@ function config_update_config () {
|
|||
$error_update[] = __('Default type of module charts.');
|
||||
if (!config_update_value ('type_interface_charts', (string) get_parameter('type_interface_charts', 'line')))
|
||||
$error_update[] = __('Default type of interface charts.');
|
||||
if (!config_update_value ('only_average', (bool) get_parameter('only_average', false)))
|
||||
$error_update[] = __('Default show only average or min and max');
|
||||
if (!config_update_value ('render_proc', (bool) get_parameter('render_proc', false)))
|
||||
$error_update[] = __('Display data of proc modules in other format');
|
||||
if (!config_update_value ('render_proc_ok', (string) get_parameter('render_proc_ok', __('Ok') )))
|
||||
|
@ -1175,11 +1171,7 @@ function config_process_config () {
|
|||
if (!isset ($config['style'])) {
|
||||
config_update_value ( 'style', 'pandora');
|
||||
}
|
||||
|
||||
if (!isset ($config['flash_charts'])) {
|
||||
config_update_value ( 'flash_charts', true);
|
||||
}
|
||||
|
||||
|
||||
if (!isset ($config["login_background"])) {
|
||||
config_update_value ('login_background', '');
|
||||
}
|
||||
|
@ -2240,10 +2232,7 @@ function config_user_set_custom_config() {
|
|||
// If block_size or flash_chart are provided then override global settings
|
||||
if (!empty($userinfo["block_size"]) && ($userinfo["block_size"] != 0))
|
||||
$config["block_size"] = $userinfo["block_size"];
|
||||
|
||||
if ($userinfo["flash_chart"] != -1)
|
||||
$config["flash_charts"] = $userinfo["flash_chart"];
|
||||
|
||||
|
||||
// Each user could have it's own timezone)
|
||||
if (isset($userinfo["timezone"])) {
|
||||
if ($userinfo["timezone"] != "") {
|
||||
|
|
|
@ -2239,7 +2239,6 @@ function events_page_details ($event, $server = "") {
|
|||
);
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$graph_params["avg_only"] = 1;
|
||||
// Set the server id
|
||||
$graph_params["server"] = $server["id"];
|
||||
}
|
||||
|
|
|
@ -234,8 +234,11 @@ function grafico_modulo_sparse_data_chart (
|
|||
|
||||
global $config;
|
||||
|
||||
//XXX add zoom
|
||||
$data_slice = $date_array['period'] / 250; //zoom
|
||||
//XXXXX
|
||||
//Para evitar mostrar todos los datos a la vez lo cual puede recargar se hace un sistema de cajas que parte de una constante = 250
|
||||
//y el periodo de tiempo seleccionado ademas de poder ir reducciendo el nivel de cajas es decir aumentando el nivel de detalle de la grafica
|
||||
//hasta la opcion full que mostraria todos los puntos(datos) que contiene ese periodo.
|
||||
$data_slice = $date_array['period'] / (250 * $params['zoom']);
|
||||
|
||||
if( $data_module_graph['id_module_type'] == 23 ||
|
||||
$data_module_graph['id_module_type'] == 3 ||
|
||||
|
@ -255,17 +258,32 @@ function grafico_modulo_sparse_data_chart (
|
|||
);
|
||||
}
|
||||
else{
|
||||
$data = db_get_all_rows_filter (
|
||||
'tagente_datos',
|
||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||
"utimestamp > '". $date_array['start_date']. "'",
|
||||
"utimestamp < '". $date_array['final_date'] . "'",
|
||||
'group' => "ROUND(utimestamp / $data_slice)",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('max(datos) as datos', 'min(utimestamp) as utimestamp'),
|
||||
'AND',
|
||||
$data_module_graph['history_db']
|
||||
);
|
||||
//all points(data)
|
||||
if($params['zoom'] == 5){
|
||||
$data = db_get_all_rows_filter (
|
||||
'tagente_datos',
|
||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||
"utimestamp > '". $date_array['start_date']. "'",
|
||||
"utimestamp < '". $date_array['final_date'] . "'",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'),
|
||||
'AND',
|
||||
$data_module_graph['history_db']
|
||||
);
|
||||
}
|
||||
else{
|
||||
$data = db_get_all_rows_filter (
|
||||
'tagente_datos',
|
||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||
"utimestamp > '". $date_array['start_date']. "'",
|
||||
"utimestamp < '". $date_array['final_date'] . "'",
|
||||
'group' => "ROUND(utimestamp / $data_slice)",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('sum(datos)/count(datos) as datos', 'min(utimestamp) as utimestamp'),
|
||||
'AND',
|
||||
$data_module_graph['history_db']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if($data === false){
|
||||
|
@ -847,10 +865,13 @@ function grafico_modulo_sparse ($params) {
|
|||
$params['graph_combined'] = false;
|
||||
}
|
||||
|
||||
if(!isset($params['zoom'])){
|
||||
$params['zoom'] = 1;
|
||||
}
|
||||
|
||||
//XXXX Configurable
|
||||
$params['grid_color'] = '#C1C1C1';
|
||||
$params['legend_color'] = '#636363';
|
||||
|
||||
$params['font'] = $config['fontpath'];
|
||||
$params['font-size'] = $config['font_size'];
|
||||
$params['short_data'] = $config['short_module_graph_data'];
|
||||
|
@ -1318,6 +1339,18 @@ function graphic_combined_module (
|
|||
return generator_chart_to_pdf('combined', $params, $params_combined, $module_list);
|
||||
}
|
||||
|
||||
if(!isset($params['zoom'])){
|
||||
$params['zoom'] = 1;
|
||||
}
|
||||
|
||||
//XXXXXXXX
|
||||
//XXXX Configurable
|
||||
$params['grid_color'] = '#C1C1C1';
|
||||
$params['legend_color'] = '#636363';
|
||||
$params['font'] = $config['fontpath'];
|
||||
$params['font-size'] = $config['font_size'];
|
||||
$params['short_data'] = $config['short_module_graph_data'];
|
||||
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
|
|
|
@ -6447,13 +6447,6 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
|
|||
$label = reporting_label_macro($content, $label);
|
||||
}
|
||||
|
||||
$only_avg = true;
|
||||
// Due to database compatibility problems, the 'only_avg' value
|
||||
// is stored into the json contained into the 'style' column.
|
||||
if (isset($content['style']['only_avg'])) {
|
||||
$only_avg = (bool) $content['style']['only_avg'];
|
||||
}
|
||||
|
||||
if (isset($content['style']['fullscale'])) {
|
||||
$fullscale = (bool) $content['style']['fullscale'];
|
||||
}
|
||||
|
@ -6484,7 +6477,6 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
|
|||
'agent_module_id' => $content['id_agent_module'],
|
||||
'period' => $content['period'],
|
||||
'title' => $label,
|
||||
'avg_only' => $only_avg,
|
||||
'pure' => false,
|
||||
'date' => $report["datetime"],
|
||||
'only_image' => $only_image,
|
||||
|
|
|
@ -902,9 +902,6 @@ function pandoraFlotArea( graph_id, values, legend,
|
|||
//XXXXX
|
||||
var markins_graph = true;
|
||||
|
||||
var legend_events = null;
|
||||
var legend_alerts = null;
|
||||
|
||||
// If threshold and up are the same, that critical or warning is disabled
|
||||
if (yellow_threshold == yellow_up){
|
||||
yellow_inverse = false;
|
||||
|
@ -923,10 +920,6 @@ function pandoraFlotArea( graph_id, values, legend,
|
|||
var red_only_min = ((red_up == 0) && (red_threshold != 0));
|
||||
|
||||
//color
|
||||
var normalw = '#efe';
|
||||
var warningw = '#ffe';
|
||||
var criticalw = '#fee';
|
||||
var normal = '#0f0';
|
||||
var warning = 'yellow';
|
||||
var critical = 'red';
|
||||
|
||||
|
@ -1629,8 +1622,8 @@ console.log(grid_color);
|
|||
autoHighlight: true
|
||||
},
|
||||
xaxis: {
|
||||
min: date_array.start_date * 1000,
|
||||
max: date_array.final_date * 1000
|
||||
min: min_x,
|
||||
max: max_x
|
||||
},
|
||||
xaxes: [{
|
||||
axisLabelUseCanvas: true,
|
||||
|
@ -2004,7 +1997,7 @@ if (vconsole) {
|
|||
.eq(i).css('color', legend_color);
|
||||
|
||||
$('#legend_' + graph_id + ' .legendLabel')
|
||||
.eq(i).css('font-family',font+'Font');
|
||||
.eq(i).css('font-family',font);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ class ModuleGraph {
|
|||
private $width = 0;
|
||||
private $height = 0;
|
||||
private $draw_alerts = 0;
|
||||
private $avg_only = 0;
|
||||
private $start_date = 0;
|
||||
private $time_compare_separated = 0;
|
||||
private $time_compare_overlapped = 0;
|
||||
|
@ -65,7 +64,6 @@ class ModuleGraph {
|
|||
}
|
||||
$this->draw_events = (int)$system->getRequest('draw_events', 0);
|
||||
$this->draw_alerts = (int)$system->getRequest('draw_alerts', 0);
|
||||
$this->avg_only = (int)$system->getRequest('avg_only', 0);
|
||||
$this->start_date = $system->getRequest('start_date', false);
|
||||
if ($this->start_date === false) {
|
||||
$this->start_date = date("Y-m-d");
|
||||
|
@ -144,7 +142,6 @@ class ModuleGraph {
|
|||
'width' => $this->width,
|
||||
'height' => $this->height,
|
||||
'show_alerts' => $this->draw_alerts,
|
||||
'avg_only' => $this->avg_only,
|
||||
'date' => $date,
|
||||
'unit' => $unit,
|
||||
'baseline' => $this->baseline,
|
||||
|
@ -245,7 +242,6 @@ class ModuleGraph {
|
|||
postvars["time_compare_separated"] = ($("input[name = 'time_compare_separated']").is(":checked"))?1:0;
|
||||
postvars["time_compare_overlapped"] = ($("input[name = 'time_compare_overlapped']").is(":checked"))?1:0;
|
||||
postvars["unknown_graph"] = ($("input[name = 'unknown_graph']").is(":checked"))?1:0;;
|
||||
postvars["avg_only"] = ($("input[name = 'avg_only']").is(":checked"))?1:0;;
|
||||
|
||||
postvars["period_hours"] = $("input[name = 'period_hours']").val();
|
||||
postvars["zoom"] = $("input[name = 'zoom']").val();
|
||||
|
@ -358,14 +354,6 @@ class ModuleGraph {
|
|||
);
|
||||
$ui->formAddCheckbox($options);
|
||||
|
||||
$options = array(
|
||||
'name' => 'avg_only',
|
||||
'value' => 1,
|
||||
'checked' => (bool)$this->avg_only,
|
||||
'label' => __('Avg Only')
|
||||
);
|
||||
$ui->formAddCheckbox($options);
|
||||
|
||||
$options = array(
|
||||
'label' => __('Time range (hours)'),
|
||||
'name' => 'period_hours',
|
||||
|
|
|
@ -29,7 +29,6 @@ if (! check_acl ($config['id_user'], $id_grupo, "AR") && ! check_acl ($config['i
|
|||
require_once ($config["homedir"] . '/include/functions_graph.php');
|
||||
|
||||
$draw_alerts = get_parameter("draw_alerts", 0);
|
||||
$avg_only = get_parameter ("avg_only", 1);
|
||||
$period = get_parameter ("period", SECONDS_1HOUR);
|
||||
$width = get_parameter ("width", 555);
|
||||
$height = get_parameter ("height", 245);
|
||||
|
@ -228,7 +227,6 @@ else {
|
|||
. 'data-draw_events="'. (int)$draw_events . '"'
|
||||
. 'data-title="'. $title . '"'
|
||||
. 'data-draw_alerts="'. (int)$draw_alerts . '"'
|
||||
. 'data-avg_only="'. (int)$avg_only . '"'
|
||||
. 'data-date="'. $date . '"'
|
||||
. 'data-unit="'. $unit . '"'
|
||||
. 'data-date="'. $date . '"'
|
||||
|
@ -401,7 +399,6 @@ echo "</div>";
|
|||
height: height,
|
||||
title: title,
|
||||
show_alerts: showAlerts,
|
||||
avg_only: avgOnly,
|
||||
date: date,
|
||||
unit: unit,
|
||||
type_g: type_g
|
||||
|
@ -467,7 +464,6 @@ echo "</div>";
|
|||
var showEvents = $container.data('draw_events');
|
||||
var title = $container.data('title');
|
||||
var showAlerts = $container.data('draw_alerts');
|
||||
var avgOnly = $container.data('avg_only');
|
||||
var date = $container.data('date');
|
||||
var unit = $container.data('unit');
|
||||
var date = $container.data('date');
|
||||
|
|
|
@ -102,15 +102,6 @@ $interface_traffic_modules = array(
|
|||
|
||||
period_select_init(periodSelectId);
|
||||
};
|
||||
|
||||
function show_others() {
|
||||
if (!$("#checkbox-avg_only").attr('checked')) {
|
||||
$("#hidden-show_other").val(1);
|
||||
}
|
||||
else {
|
||||
$("#hidden-show_other").val(0);
|
||||
}
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
</head>
|
||||
|
@ -165,19 +156,6 @@ $interface_traffic_modules = array(
|
|||
}
|
||||
}
|
||||
|
||||
if ($zoom > 1) {
|
||||
$height = $height * ($zoom / 2.1);
|
||||
$width = $width * ($zoom / 1.4);
|
||||
echo "<script type='text/javascript'>window.resizeTo($width + 120, $height + 320);</script>";
|
||||
}
|
||||
|
||||
/*$current = date("Y-m-d");
|
||||
|
||||
if ($start_date != $current)
|
||||
$date = strtotime($start_date);
|
||||
else
|
||||
$date = $utime;
|
||||
*/
|
||||
$date = strtotime("$start_date $start_time");
|
||||
$now = time();
|
||||
|
||||
|
@ -203,16 +181,25 @@ $interface_traffic_modules = array(
|
|||
'date' => $date,
|
||||
'homeurl' => $config['homeurl'],
|
||||
'percentil' => (($show_percentil)? $config['percentil'] : null),
|
||||
'fullscale' => $fullscale
|
||||
'fullscale' => $fullscale,
|
||||
'zoom' => $zoom
|
||||
);
|
||||
|
||||
if($config['type_interface_charts'] == 'line'){
|
||||
$stacked = CUSTOM_GRAPH_LINE;
|
||||
}
|
||||
else{
|
||||
$stacked = CUSTOM_GRAPH_AREA;
|
||||
}
|
||||
|
||||
$params_combined = array(
|
||||
'weight_list' => array(),
|
||||
'projection' => false,
|
||||
'labels' => array_keys($interface_traffic_modules),
|
||||
'from_interface' => true,
|
||||
'modules_series' => array_values($interface_traffic_modules),
|
||||
'return' => 0
|
||||
'return' => 0,
|
||||
'stacked' => $stacked
|
||||
);
|
||||
|
||||
graphic_combined_module(
|
||||
|
@ -297,7 +284,8 @@ $interface_traffic_modules = array(
|
|||
$options[2] = 'x2';
|
||||
$options[3] = 'x3';
|
||||
$options[4] = 'x4';
|
||||
$data[1] = html_print_select($options, "zoom", $zoom, '', '', 0, true);
|
||||
$options[5] = __('Full');
|
||||
$data[1] = html_print_select($options, "zoom", $zoom, '', '', 0, true, false, false);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
|
|
@ -96,15 +96,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
|
||||
period_select_init(periodSelectId);
|
||||
};
|
||||
|
||||
function show_others() {
|
||||
if ($('#checkbox-avg_only').is(":checked") == true) {
|
||||
$("#hidden-show_other").val(1);
|
||||
}
|
||||
else {
|
||||
$("#hidden-show_other").val(0);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#ffffff" style='background:#ffffff;'>
|
||||
|
@ -142,16 +133,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
|
||||
$draw_alerts = get_parameter("draw_alerts", 0);
|
||||
|
||||
if(isset($config['only_average'])){
|
||||
$avg_only = $config['only_average'];
|
||||
}
|
||||
|
||||
$show_other = get_parameter('show_other',-1);
|
||||
|
||||
if ($show_other != -1) {
|
||||
$avg_only = $show_other;
|
||||
}
|
||||
|
||||
$period = get_parameter ("period");
|
||||
$id = get_parameter ("id", 0);
|
||||
$label = get_parameter ("label", "");
|
||||
|
@ -236,7 +217,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
'title' => $label_graph,
|
||||
'unit_name' => $unit,
|
||||
'show_alerts' => $draw_alerts,
|
||||
'avg_only' => $avg_only,
|
||||
'date' => $date,
|
||||
'unit' => $unit,
|
||||
'baseline' => $baseline,
|
||||
|
@ -246,7 +226,8 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
'show_unknown' => $unknown_graph,
|
||||
'percentil' => (($show_percentil)? $config['percentil'] : null),
|
||||
'type_graph' => $config['type_module_charts'],
|
||||
'fullscale' => $fullscale
|
||||
'fullscale' => $fullscale,
|
||||
'zoom' => $zoom
|
||||
);
|
||||
echo grafico_modulo_sparse ($params);
|
||||
echo '<br>';
|
||||
|
@ -303,16 +284,6 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
if ($graph_type != "boolean" && $graph_type != "string") {
|
||||
$data = array();
|
||||
$data[0] = __('Avg. Only');
|
||||
$data[1] = html_print_checkbox ("avg_only", 1,
|
||||
(bool)$avg_only, true, false, 'show_others()');
|
||||
$data[1] .= html_print_input_hidden('show_other', 0, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Begin date');
|
||||
$data[1] = html_print_input_text ("start_date", $start_date,'', 10, 20, true);
|
||||
|
@ -326,14 +297,15 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Zoom factor');
|
||||
$data[0] = __('Zoom');
|
||||
$options = array ();
|
||||
$options[$zoom] = 'x' . $zoom;
|
||||
$options[1] = 'x1';
|
||||
$options[2] = 'x2';
|
||||
$options[3] = 'x3';
|
||||
$options[4] = 'x4';
|
||||
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true);
|
||||
$options[5] = __('full');
|
||||
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
|
@ -367,11 +339,13 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent);
|
|||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
/*
|
||||
$data = array();
|
||||
$data[0] = __('Show event graph');
|
||||
$data[1] = html_print_checkbox ("show_events_graph", 1, (bool) $show_events_graph, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
*/
|
||||
|
||||
switch ($graph_type) {
|
||||
case 'boolean':
|
||||
|
|
|
@ -1268,7 +1268,6 @@ if (!empty($result)) {
|
|||
);
|
||||
|
||||
if (is_metaconsole() && isset($row['server_id'])) {
|
||||
$graph_params['avg_only'] = 1;
|
||||
// Set the server id
|
||||
$graph_params['server'] = $row['server_id'];
|
||||
}
|
||||
|
|
|
@ -164,8 +164,7 @@ function main_intel_dcm_agent_view () {
|
|||
$draw_events = false;
|
||||
$draw_alerts = false;
|
||||
$period = 7200;
|
||||
$avg_only = true;
|
||||
|
||||
|
||||
$module = modules_get_agentmodule_id (io_safe_input("Avg. Power"), $id_agent);
|
||||
$unit = modules_get_unit ($module['id_agente_modulo']);
|
||||
|
||||
|
@ -178,7 +177,6 @@ function main_intel_dcm_agent_view () {
|
|||
'title' => $module['nombre'],
|
||||
'unit_name' => null,
|
||||
'show_alerts' => $draw_alerts,
|
||||
'avg_only' => $avg_only,
|
||||
'pure' => false,
|
||||
'date' => $date,
|
||||
'unit' => $unit
|
||||
|
@ -213,7 +211,6 @@ function main_intel_dcm_agent_view () {
|
|||
'title' => $module['nombre'],
|
||||
'unit_name' => null,
|
||||
'show_alerts' => $draw_alerts,
|
||||
'avg_only' => $avg_only,
|
||||
'pure' => false,
|
||||
'date' => $date,
|
||||
'unit' => $unit
|
||||
|
@ -232,7 +229,6 @@ function main_intel_dcm_agent_view () {
|
|||
'title' => $module['nombre'],
|
||||
'unit_name' => null,
|
||||
'show_alerts' => $draw_alerts,
|
||||
'avg_only' => $avg_only,
|
||||
'pure' => false,
|
||||
'date' => $date,
|
||||
'unit' => $unit
|
||||
|
|
Loading…
Reference in New Issue