diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
index 6a8ea04e0f..55b967aa08 100755
--- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php
+++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
@@ -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':
@@ -2504,6 +2506,23 @@ $class = 'databox filters';
+
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');
diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php
index 802f73a341..f97324dfc4 100644
--- a/pandora_console/include/class/AgentWizard.class.php
+++ b/pandora_console/include/class/AgentWizard.class.php
@@ -1196,7 +1196,7 @@ class AgentWizard extends HTML
$table->head[1] = ''.__('Server').'';
$table->head[2] = ''.__('Type').'';
$table->head[3] = ''.__('Description').'';
- $table->head[4] = ''.__('Treshold').'';
+ $table->head[4] = ''.__('Threshold').'';
$table->data = [];
diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php
index c5de8c5b78..09a3430f98 100644
--- a/pandora_console/include/functions_api.php
+++ b/pandora_console/include/functions_api.php
@@ -14699,7 +14699,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,
];
diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php
index 99dd0cad88..1d6f7f4ce3 100644
--- a/pandora_console/include/functions_graph.php
+++ b/pandora_console/include/functions_graph.php
@@ -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) {
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 2e590a6487..10852ee8b3 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -10159,6 +10159,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.
@@ -10213,6 +10218,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) {
diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js
index 2270c0276f..fb6a79cd3d 100644
--- a/pandora_console/include/graphs/flot/pandora.flot.js
+++ b/pandora_console/include/graphs/flot/pandora.flot.js
@@ -1017,7 +1017,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;
@@ -2212,7 +2212,7 @@ function pandoraFlotArea(
}
if (thresholded) {
- var data_base_treshold = add_threshold(
+ var data_base_threshold = add_threshold(
data_base,
threshold_data,
ranges.yaxis.from,
@@ -2225,7 +2225,7 @@ function pandoraFlotArea(
plot = $.plot(
$("#" + graph_id),
- data_base_treshold,
+ data_base_threshold,
$.extend(true, {}, options, {
grid: {
borderWidth: 1,
@@ -2611,7 +2611,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
@@ -2625,7 +2625,7 @@ function pandoraFlotArea(
);
}
- var datas_treshold = add_threshold(
+ var datas_threshold = add_threshold(
data_base,
threshold_data,
plot.getAxes().yaxis.min,
@@ -2638,7 +2638,7 @@ function pandoraFlotArea(
plot = $.plot(
$("#" + graph_id),
- datas_treshold,
+ datas_threshold,
$.extend(true, {}, options, {
yaxis: {
max: y_recal.max
@@ -2772,7 +2772,7 @@ function pandoraFlotArea(
);
}
- datas_treshold = add_threshold(
+ datas_threshold = add_threshold(
data_base,
threshold_data,
plot.getAxes().yaxis.min,
@@ -2785,7 +2785,7 @@ function pandoraFlotArea(
plot = $.plot(
$("#" + graph_id),
- datas_treshold,
+ datas_threshold,
$.extend(true, {}, options, {
yaxis: {
min: max_draw["min"],
@@ -3096,7 +3096,7 @@ function axis_thresholded(
return y;
}
-//add treshold
+//add threshold
function add_threshold(
data_base,
threshold_data,
@@ -3216,13 +3216,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"]
};
@@ -3233,7 +3233,7 @@ function add_threshold(
}
});
if (flag) {
- extreme_treshold_array[i] = {
+ extreme_threshold_array[i] = {
below: value["min"],
color: datas[0].color
};
@@ -3241,7 +3241,7 @@ function add_threshold(
}
});
- datas[0].threshold = extreme_treshold_array;
+ datas[0].threshold = extreme_threshold_array;
return datas;
}
|