add treshold pdf pandora_enterprise#1419
This commit is contained in:
parent
4ae4f6b7bd
commit
d0a04177c0
|
@ -135,6 +135,7 @@ $current_month = true;
|
|||
// Only avg is selected by default for the simple graphs.
|
||||
$fullscale = false;
|
||||
$percentil = false;
|
||||
$image_threshold = false;
|
||||
$time_compare_overlapped = false;
|
||||
|
||||
// Added for events items.
|
||||
|
@ -307,6 +308,7 @@ switch ($action) {
|
|||
case 'simple_graph':
|
||||
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
|
||||
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
|
||||
$image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false;
|
||||
$graph_render = $item['graph_render'];
|
||||
// The break hasn't be forgotten.
|
||||
case 'simple_baseline_graph':
|
||||
|
@ -2501,6 +2503,23 @@ $class = 'databox filters';
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_image_threshold" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Show threshold');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox_switch(
|
||||
'image_threshold',
|
||||
1,
|
||||
$image_threshold
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_time_compare_overlapped" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
|
@ -5945,6 +5964,7 @@ function chooseType() {
|
|||
$("#row_show_graph").hide();
|
||||
$("#row_max_min_avg").hide();
|
||||
$("#row_fullscale").hide();
|
||||
$("#row_image_threshold").hide();
|
||||
$("#row_graph_render").hide();
|
||||
$("#row_macros_definition").hide();
|
||||
$("#row_render_definition").hide();
|
||||
|
@ -6077,6 +6097,7 @@ function chooseType() {
|
|||
case 'simple_graph':
|
||||
$("#row_time_compare_overlapped").show();
|
||||
$("#row_fullscale").show();
|
||||
$("#row_image_threshold").show();
|
||||
$("#row_graph_render").show();
|
||||
$("#row_percentil").show();
|
||||
|
||||
|
|
|
@ -2249,6 +2249,9 @@ switch ($action) {
|
|||
$style['fullscale'] = (int) get_parameter(
|
||||
'fullscale'
|
||||
);
|
||||
$style['image_threshold'] = (int) get_parameter(
|
||||
'image_threshold'
|
||||
);
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
} else {
|
||||
|
@ -2994,6 +2997,9 @@ switch ($action) {
|
|||
$style['fullscale'] = (int) get_parameter(
|
||||
'fullscale'
|
||||
);
|
||||
$style['image_threshold'] = (int) get_parameter(
|
||||
'image_threshold'
|
||||
);
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
} else {
|
||||
|
|
|
@ -410,7 +410,7 @@ if (check_login()) {
|
|||
$table_modules->head = [];
|
||||
$table_modules->head[0] = __('Module name');
|
||||
$table_modules->head[1] = __('Data');
|
||||
$table_modules->head[2] = __('Treshold');
|
||||
$table_modules->head[2] = __('Threshold');
|
||||
$table_modules->head[3] = __('Current interval');
|
||||
$table_modules->head[4] = __('Timestamp');
|
||||
$table_modules->head[5] = __('Status');
|
||||
|
|
|
@ -1181,7 +1181,7 @@ class AgentWizard extends HTML
|
|||
$table->head[1] = '<b>'.__('Server').'</b>';
|
||||
$table->head[2] = '<b>'.__('Type').'</b>';
|
||||
$table->head[3] = '<b>'.__('Description').'</b>';
|
||||
$table->head[4] = '<b>'.__('Treshold').'</b>';
|
||||
$table->head[4] = '<b>'.__('Threshold').'</b>';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
|
|
|
@ -14855,7 +14855,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
|
|||
'type_graph' => $config['type_module_charts'],
|
||||
'fullscale' => false,
|
||||
'return_img_base_64' => true,
|
||||
'image_treshold' => $graph_threshold,
|
||||
'image_threshold' => $graph_threshold,
|
||||
'graph_font_size' => $graph_font_size,
|
||||
];
|
||||
|
||||
|
|
|
@ -626,7 +626,7 @@ function grafico_modulo_sparse_data(
|
|||
* 'show_legend' => true,
|
||||
* 'show_overview' => true,
|
||||
* 'return_img_base_64' => false,
|
||||
* 'image_treshold' => false,
|
||||
* 'image_threshold' => false,
|
||||
* 'graph_combined' => false,
|
||||
* 'graph_render' => 0,
|
||||
* 'zoom' => 1,
|
||||
|
@ -782,8 +782,8 @@ function grafico_modulo_sparse($params)
|
|||
$params['return_img_base_64'] = false;
|
||||
}
|
||||
|
||||
if (isset($params['image_treshold']) === false) {
|
||||
$params['image_treshold'] = false;
|
||||
if (isset($params['image_threshold']) === false) {
|
||||
$params['image_threshold'] = false;
|
||||
}
|
||||
|
||||
if (isset($params['graph_combined']) === false) {
|
||||
|
@ -1305,8 +1305,8 @@ function graphic_combined_module(
|
|||
$params['return_img_base_64'] = false;
|
||||
}
|
||||
|
||||
if (isset($params['image_treshold']) === false) {
|
||||
$params['image_treshold'] = false;
|
||||
if (isset($params['image_threshold']) === false) {
|
||||
$params['image_threshold'] = false;
|
||||
}
|
||||
|
||||
if (isset($params['show_unknown']) === false) {
|
||||
|
|
|
@ -10157,6 +10157,11 @@ function reporting_simple_graph(
|
|||
$fullscale = (bool) $content['style']['fullscale'];
|
||||
}
|
||||
|
||||
$image_threshold = false;
|
||||
if (isset($content['style']['image_threshold'])) {
|
||||
$image_threshold = (bool) $content['style']['image_threshold'];
|
||||
}
|
||||
|
||||
$return['chart'] = '';
|
||||
|
||||
// Get chart.
|
||||
|
@ -10211,6 +10216,7 @@ function reporting_simple_graph(
|
|||
'backgroundColor' => 'transparent',
|
||||
'return_img_base_64' => true,
|
||||
'graph_render' => $content['graph_render'],
|
||||
'image_threshold' => $image_threshold,
|
||||
];
|
||||
|
||||
if ($only_image === false) {
|
||||
|
|
|
@ -1003,7 +1003,7 @@ function pandoraFlotArea(
|
|||
var max_x = date_array["final_date"] * 1000;
|
||||
var type = parseInt(params.stacked);
|
||||
var show_legend = params.show_legend;
|
||||
var image_treshold = params.image_treshold;
|
||||
var image_threshold = params.image_threshold;
|
||||
var short_data = params.short_data != "" ? params.short_data : 3;
|
||||
var grid_color = params.grid_color;
|
||||
var background_color = params.backgroundColor;
|
||||
|
@ -2198,7 +2198,7 @@ function pandoraFlotArea(
|
|||
}
|
||||
|
||||
if (thresholded) {
|
||||
var data_base_treshold = add_threshold(
|
||||
var data_base_threshold = add_threshold(
|
||||
data_base,
|
||||
threshold_data,
|
||||
ranges.yaxis.from,
|
||||
|
@ -2211,7 +2211,7 @@ function pandoraFlotArea(
|
|||
|
||||
plot = $.plot(
|
||||
$("#" + graph_id),
|
||||
data_base_treshold,
|
||||
data_base_threshold,
|
||||
$.extend(true, {}, options, {
|
||||
grid: {
|
||||
borderWidth: 1,
|
||||
|
@ -2597,7 +2597,7 @@ function pandoraFlotArea(
|
|||
$("#overview_" + graph_id).bind("mouseout", resetInteractivity);
|
||||
}
|
||||
|
||||
if (image_treshold) {
|
||||
if (image_threshold) {
|
||||
var y_recal = plot.getAxes().yaxis.max;
|
||||
if (!thresholded) {
|
||||
// Recalculate the y axis
|
||||
|
@ -2611,7 +2611,7 @@ function pandoraFlotArea(
|
|||
);
|
||||
}
|
||||
|
||||
var datas_treshold = add_threshold(
|
||||
var datas_threshold = add_threshold(
|
||||
data_base,
|
||||
threshold_data,
|
||||
plot.getAxes().yaxis.min,
|
||||
|
@ -2624,7 +2624,7 @@ function pandoraFlotArea(
|
|||
|
||||
plot = $.plot(
|
||||
$("#" + graph_id),
|
||||
datas_treshold,
|
||||
datas_threshold,
|
||||
$.extend(true, {}, options, {
|
||||
yaxis: {
|
||||
max: y_recal.max
|
||||
|
@ -2758,7 +2758,7 @@ function pandoraFlotArea(
|
|||
);
|
||||
}
|
||||
|
||||
datas_treshold = add_threshold(
|
||||
datas_threshold = add_threshold(
|
||||
data_base,
|
||||
threshold_data,
|
||||
plot.getAxes().yaxis.min,
|
||||
|
@ -2771,7 +2771,7 @@ function pandoraFlotArea(
|
|||
|
||||
plot = $.plot(
|
||||
$("#" + graph_id),
|
||||
datas_treshold,
|
||||
datas_threshold,
|
||||
$.extend(true, {}, options, {
|
||||
yaxis: {
|
||||
min: max_draw["min"],
|
||||
|
@ -3115,7 +3115,7 @@ function axis_thresholded(
|
|||
return y;
|
||||
}
|
||||
|
||||
//add treshold
|
||||
//add threshold
|
||||
function add_threshold(
|
||||
data_base,
|
||||
threshold_data,
|
||||
|
@ -3235,13 +3235,13 @@ function add_threshold(
|
|||
}
|
||||
});
|
||||
|
||||
var extreme_treshold_array = [];
|
||||
var extreme_threshold_array = [];
|
||||
var i = 0;
|
||||
var flag = true;
|
||||
|
||||
$.each(threshold_array, function(index, value) {
|
||||
flag = true;
|
||||
extreme_treshold_array[i] = {
|
||||
extreme_threshold_array[i] = {
|
||||
below: value["max"],
|
||||
color: value["color"]
|
||||
};
|
||||
|
@ -3252,7 +3252,7 @@ function add_threshold(
|
|||
}
|
||||
});
|
||||
if (flag) {
|
||||
extreme_treshold_array[i] = {
|
||||
extreme_threshold_array[i] = {
|
||||
below: value["min"],
|
||||
color: datas[0].color
|
||||
};
|
||||
|
@ -3260,7 +3260,7 @@ function add_threshold(
|
|||
}
|
||||
});
|
||||
|
||||
datas[0].threshold = extreme_treshold_array;
|
||||
datas[0].threshold = extreme_threshold_array;
|
||||
|
||||
return datas;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue