";
// Set some containers to legend, graph, timestamp tooltip, etc.
- $return .= "
";
+ if($params['show_legend']){
+ $return .= "
";
+ }
+
if(!isset($params['combined']) || !$params['combined']){
$yellow_threshold = $data_module_graph['w_min'];
$red_threshold = $data_module_graph['c_min'];
@@ -171,12 +176,14 @@ function flot_area_graph (
if ($params['menu']) {
$return .= menu_graph(
- $yellow_threshold, $red_threshold,
- $yellow_up, $red_up, $yellow_inverse,
- $red_inverse, $params['dashboard'],
- $params['vconsole'],
- $graph_id, $params['width'],
- $params['homeurl']
+ $yellow_threshold,
+ $red_threshold,
+ $yellow_up,
+ $red_up,
+ $yellow_inverse,
+ $red_inverse,
+ $graph_id,
+ $params
);
}
@@ -281,7 +288,6 @@ function flot_area_graph (
"JSON.parse('$data_module_graph'), \n" .
"JSON.parse('$params'), \n" .
"$force_integer, \n" .
- "'$series_suffix_str', \n" .
"'$background_color', \n" .
"'$legend_color', \n" .
"'$short_data', \n" .
@@ -299,8 +305,7 @@ function flot_area_graph (
function menu_graph(
$yellow_threshold, $red_threshold,
$yellow_up, $red_up, $yellow_inverse,
- $red_inverse, $dashboard, $vconsole,
- $graph_id, $width, $homeurl
+ $red_inverse, $graph_id, $params
){
$return = '';
$threshold = false;
@@ -308,34 +313,31 @@ function menu_graph(
$threshold = true;
}
- $nbuttons = 3;
-
- if ($threshold) {
- $nbuttons++;
- }
- $menu_width = 25 * $nbuttons + 15;
- if ( $dashboard == false AND $vconsole == false) {
- $return .= "";
diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php
index dd66d9173d..e987e5ab5b 100644
--- a/pandora_console/include/graphs/functions_pchart.php
+++ b/pandora_console/include/graphs/functions_pchart.php
@@ -883,11 +883,6 @@ function pch_vertical_graph ($graph_type, $index, $data, $width, $height,
global $config;
- html_debug_print($graph_type, true);
- html_debug_print($index, true);
- html_debug_print($data, true);
-
-
/* Create and populate the pData object */
$MyData = new pData();
$MyData->addPoints(array(20,22,25,5,12,8,30,8),"Probe 1");
diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js
index 6f4a59cab1..6113caacf3 100644
--- a/pandora_console/include/graphs/pandora.d3.js
+++ b/pandora_console/include/graphs/pandora.d3.js
@@ -1024,41 +1024,40 @@ function createGauge(name, etiqueta, value, min, max, min_warning,max_warning,wa
function createGauges(data, width, height, font_size, no_data_image, font) {
var nombre,label,minimun_warning,maximun_warning,minimun_critical,maximun_critical,
mininum,maxinum,valor;
-
+
for (key in data) {
nombre = data[key].gauge;
-
+
label = data[key].label;
-
+
label = label.replace(/ /g,' ');
label = label.replace(/\(/g,'\(');
label = label.replace(/\)/g,'\)');
-
+
label = label.replace(/(/g,'\(');
label = label.replace(/)/g,'\)');
-
- minimun_warning = round_with_decimals(parseFloat( data[key].min_warning ));
- maximun_warning = round_with_decimals(parseFloat( data[key].max_warning ));
- minimun_critical = round_with_decimals(parseFloat( data[key].min_critical ));
- maximun_critical = round_with_decimals(parseFloat( data[key].max_critical ));
+
+ minimun_warning = round_with_decimals(parseFloat( data[key].min_warning ));
+ maximun_warning = round_with_decimals(parseFloat( data[key].max_warning ));
+ minimun_critical = round_with_decimals(parseFloat( data[key].min_critical ));
+ maximun_critical = round_with_decimals(parseFloat( data[key].max_critical ));
mininum = round_with_decimals(parseFloat(data[key].min));
maxinum = round_with_decimals(parseFloat(data[key].max));
-
+
critical_inverse = parseInt(data[key].critical_inverse);
warning_inverse = parseInt(data[key].warning_inverse);
valor = round_with_decimals(data[key].value);
+
if (isNaN(valor))
valor = null;
- createGauge(nombre, label, valor, mininum, maxinum,
+ createGauge(nombre, label, valor, mininum, maxinum,
minimun_warning, maximun_warning, warning_inverse, minimun_critical,
maximun_critical, critical_inverse, font_size, height, font);
-
}
-
}
@@ -1265,8 +1264,10 @@ function Gauge(placeholderName, configuration, font)
this.drawBand = function(start, end, color)
{
+ if (start === undefined) return;
+ if (end === undefined) return;
if (0 >= end - start) return;
-
+
this.body.append("svg:path")
.style("fill", color)
.attr("d", d3.svg.arc()
@@ -1276,13 +1277,13 @@ function Gauge(placeholderName, configuration, font)
.outerRadius(Math.round(0.85 * this.config.raduis)))
.attr("transform", function() { return "translate(" + self.config.cx + ", " + self.config.cy + ") rotate(270)" });
}
-
+
this.redraw = function(value, transitionDuration)
{
var pointerContainer = this.body.select(".pointerContainer");
-
+
pointerContainer.selectAll("text").text(round_with_decimals(value));
-
+
var pointer = pointerContainer.selectAll("path");
pointer.transition()
.duration(undefined != transitionDuration ? transitionDuration : this.config.transitionDuration)
@@ -1297,7 +1298,7 @@ function Gauge(placeholderName, configuration, font)
var targetRotation = (self.valueToDegrees(pointerValue) - 90);
var currentRotation = self._currentRotation || targetRotation;
self._currentRotation = targetRotation;
-
+
return function(step)
{
var rotation = currentRotation + (targetRotation-currentRotation)*step;
diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js
index 0cdb3e44b3..af4373bbab 100644
--- a/pandora_console/include/javascript/pandora.js
+++ b/pandora_console/include/javascript/pandora.js
@@ -1553,7 +1553,10 @@ function paint_graph_status(min_w, max_w, min_c, max_c, inverse_w, inverse_c, er
}
}
-function round_with_decimals (value, multiplier = 1) {
+function round_with_decimals(value, multiplier) {
+ // Default values
+ if (typeof(multiplier) === "undefined") multiplier = 1;
+
// Return non numeric types without modification
if (typeof(value) !== "number") return value;
@@ -1564,24 +1567,6 @@ function round_with_decimals (value, multiplier = 1) {
return round_with_decimals (value, multiplier * 10);
}
-/*
-
- $("body").append('
' + '' + '
');
- $("#event_delete_confirm_dialog").dialog({
- resizable: false,
- draggable: false,
- modal: true,
- height: 280,
- width: 330,
- overlay: {
- opacity: 0.5,
- background: "black"
- },
- closeOnEscape: false,
- open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
- });
-*/
-
/**
* Display a confirm dialog box
*
@@ -1590,12 +1575,7 @@ function round_with_decimals (value, multiplier = 1) {
* @param string Cancel button text
* @param function Callback to action when ok button is pressed
*/
-function display_confirm_dialog (
- message = '',
- ok_text = '',
- cancel_text = '',
- ok_function = function () {}
-) {
+function display_confirm_dialog (message, ok_text, cancel_text, ok_function) {
// Clean function to close the dialog
var clean_function = function () {
$("#pandora_confirm_dialog_text").hide();
diff --git a/pandora_console/include/web2image.js b/pandora_console/include/web2image.js
index 87ff234e01..85ae6ac37a 100644
--- a/pandora_console/include/web2image.js
+++ b/pandora_console/include/web2image.js
@@ -38,10 +38,14 @@ page.viewportSize = { width: _width, height: _height };
//page.zoomFactor = 1.75;
page.open(finish_url, function start(status) {
+ page.includeJs('./javascript/pandora.js');
+});
+
+page.onLoadFinished = function (status) {
page.render(output_filename, {format: 'png'});
//var base64 = page.renderBase64('JPG');
//console.log(base64);
phantom.exit();
-});
+}
diff --git a/pandora_console/mobile/operation/module_graph.php b/pandora_console/mobile/operation/module_graph.php
index 249a4e770e..31be54c7f8 100644
--- a/pandora_console/mobile/operation/module_graph.php
+++ b/pandora_console/mobile/operation/module_graph.php
@@ -153,7 +153,8 @@ class ModuleGraph {
'compare' => $time_compare,
'show_unknown' => $this->unknown_graph,
'menu' => false,
- 'type_graph' => $config['type_module_charts']
+ 'type_graph' => $config['type_module_charts'],
+ 'vconsole' => true
);
$graph = grafico_modulo_sparse($params);
diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php
index 57b87cb6eb..57a50e6c9a 100755
--- a/pandora_console/operation/agentes/estado_generalagente.php
+++ b/pandora_console/operation/agentes/estado_generalagente.php
@@ -280,13 +280,15 @@ $access_agent = db_get_value_sql("SELECT COUNT(id_agent)
WHERE id_agent = " . $id_agente);
if ($config["agentaccess"] && $access_agent > 0) {
$data[2] =
- '