From a484fb24084543d6fe978aa9b20a7d902312ebcc Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Thu, 8 Jul 2021 10:03:57 +0200 Subject: [PATCH] fixed several issues in item module graph of visual consoles --- pandora_console/include/functions_graph.php | 2 +- pandora_console/include/graphs/functions_flot.php | 2 +- .../include/rest-api/models/VisualConsole/Item.php | 14 ++++++++++++++ .../include/rest-api/models/VisualConsole/View.php | 5 +++++ pandora_console/include/styles/pandora_black.css | 7 ++++++- 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index a5463283db..0b69c769ad 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -735,7 +735,7 @@ function grafico_modulo_sparse($params) $params['backgroundColor'] = 'white'; } - if (isset($params['only_image']) === true) { + if (isset($params['only_image']) === true && $params['vconsole'] !== true) { $params['backgroundColor'] = 'transparent'; } diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 247dc911b8..a193131d51 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -170,7 +170,7 @@ function flot_area_graph( // Set some containers to legend, graph, timestamp tooltip, etc. if ($params['show_legend']) { - $return .= '

'; + $return .= '

'; } if (isset($params['graph_combined']) === true && $params['graph_combined'] diff --git a/pandora_console/include/rest-api/models/VisualConsole/Item.php b/pandora_console/include/rest-api/models/VisualConsole/Item.php index 88db023910..2f1c687de7 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Item.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Item.php @@ -1517,6 +1517,20 @@ class Item extends CachedModel $result['border_color'] = $border_color; } + $id_custom_graph = static::parseIntOr( + static::issetInArray( + $data, + [ + 'customGraphId', + 'id_custom_graph', + ] + ), + null + ); + if ($id_custom_graph !== null) { + $result['id_custom_graph'] = $id_custom_graph; + } + $linked_layout_node_id = static::parseIntOr( static::issetInArray( $data, diff --git a/pandora_console/include/rest-api/models/VisualConsole/View.php b/pandora_console/include/rest-api/models/VisualConsole/View.php index d852d7ba30..04c3c38466 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/View.php +++ b/pandora_console/include/rest-api/models/VisualConsole/View.php @@ -356,10 +356,15 @@ class View extends \HTML case MODULE_GRAPH: $data['backgroundType'] = \get_parameter('backgroundType'); + $type = \get_parameter('choosetype'); $data['agentId'] = \get_parameter('agentId'); $data['metaconsoleId'] = \get_parameter('metaconsoleId'); $data['moduleId'] = \get_parameter('moduleId'); $data['customGraphId'] = \get_parameter('customGraphId'); + if ($type === 'module') { + $data['customGraphId'] = 0; + } + $data['graphType'] = \get_parameter('graphType'); $data['showLegend'] = \get_parameter_switch('showLegend'); $data['period'] = \get_parameter('period'); diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 63a0bb6e85..aea568b5d9 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -398,7 +398,7 @@ table#diagnostic_info tbody td div { } .ui-widget-content, .ui-widget-content a { - color: #fff; + color: #fff !important; } .ui-widget-content.ui-autocomplete a { @@ -1159,3 +1159,8 @@ a.pandora_pagination, padding-right: 35px; background-color: #222; } + +.legend_background { + background-color: #222; + color: #fff !important; +}