From 28b0e4f64fafe8c284c7da3b2ea1b750fab5ab20 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 11 Apr 2024 08:18:42 +0200 Subject: [PATCH 1/5] 13473-Fix multi select2 in widget config --- pandora_console/include/styles/dashboards.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/styles/dashboards.css b/pandora_console/include/styles/dashboards.css index fb53e37c35..883c89d9c3 100644 --- a/pandora_console/include/styles/dashboards.css +++ b/pandora_console/include/styles/dashboards.css @@ -994,3 +994,7 @@ input.resize_button { width: 100%; justify-content: center; } + +ul.select2-selection__rendered > li.select2-selection__choice { + box-sizing: border-box !important; +} From d967b7076a9abf17b899a8fac2d628914af5e908 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Fri, 12 Apr 2024 08:53:11 +0200 Subject: [PATCH 2/5] 13473-Fix acl widgets Block histogram, Module histogram and Tree view (histogram graph) --- pandora_console/include/functions_events.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index eba07feece..856d91575c 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1674,6 +1674,12 @@ function events_get_all( } } + if (!$user_is_admin && users_can_manage_group_all('ER') === false) { + if (str_contains($fields[0], 'te.id_grupo') === false) { + $fields[0] .= ', te.id_grupo'; + } + } + if (((int) $filter['group_rep'] === EVENT_GROUP_REP_EVENTS || (int) $filter['group_rep'] === EVENT_GROUP_REP_EXTRAIDS) && $count === false ) { From 8de1e7b218a769f63339cb2b3851e9203ee9b966 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Fri, 12 Apr 2024 13:11:37 +0200 Subject: [PATCH 3/5] 13402-Fix margins in widget Basic chart --- .../include/graphs/functions_flot.php | 8 ++++++- .../lib/Dashboard/Widgets/BasicChart.php | 21 +++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 329e515f06..0f0c2a86aa 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -303,9 +303,15 @@ function flot_area_graph( } } + $extra_styles = ''; + if (isset($params['extra_styles']) === true && empty($params['extra_styles']) === false) { + $extra_styles = $params['extra_styles']; + } + $return .= 'graph'.$params['adapt_key']."' style='".$width.'; - height: '.$params['height']."px;'>"; + height: '.$params['height'].'px; + '.$extra_styles."'>"; $legend_top = 10; if (empty($params['show_legend']) === false) { diff --git a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php index a140d7fcb4..0910f0ba68 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php +++ b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php @@ -641,12 +641,28 @@ class BasicChart extends Widget $this->values['period'] = parent::getPeriod(); } + $margin = 10; + $size['height'] -= $margin; + $graph_height = $size['height']; + $margin_top = 0; + if ((bool) $this->values['showLabel'] === true) { + $margin_top = $this->values['sizeLabel']; + } + + if ((bool) $this->values['showValue'] === true) { + if ($this->values['sizeValue'] > $this->values['sizeLabel']) { + $margin_top = $this->values['sizeValue']; + } + } + + $graph_height -= $margin_top; + $params = [ 'agent_module_id' => $this->values['moduleId'], 'period' => $this->values['period'], 'show_events' => false, 'width' => '100%', - 'height' => $size['height'], + 'height' => $graph_height, 'title' => $module_name, 'unit' => $units_name, 'only_image' => false, @@ -661,6 +677,7 @@ class BasicChart extends Widget 'backgroundColor' => 'transparent', // 'server_id' => $metaconsoleId, 'basic_chart' => true, + 'extra_styles' => 'bottom: -'.($margin_top + $margin - 1).'px; margin-left: 0px;', 'array_colors' => [ [ 'border' => '#000000', @@ -671,7 +688,7 @@ class BasicChart extends Widget ]; $graph = \grafico_modulo_sparse($params); - $output = '
'; + $output = '
'; if (str_contains($graph, 'values['colorLabel'].'; font-size:'.$this->values['sizeLabel'].'px;">'; From d8fa1d51f6086ebb988b9e472b3cc422fa96a31d Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 15 Apr 2024 11:11:00 +0200 Subject: [PATCH 4/5] 13395-Fix about tabs styles --- pandora_console/include/javascript/pandora.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 338bdf2c8f..0ddc26c102 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -2407,7 +2407,9 @@ $(document).ready(function() { closeOnEscape: true, width: 700, height: 450, - + close: function() { + closeAboutModal(); + }, create: function() { $("#about-tabs").tabs({}); $(".ui-dialog-titlebar").remove(); @@ -2415,7 +2417,6 @@ $(document).ready(function() { $("#about-close").click(function() { $("#about-tabs").dialog("close"); $("div.ui-dialog").remove(); - $("#icon_about").removeClass("selected"); }); } }); @@ -2436,7 +2437,9 @@ $(document).ready(function() { closeOnEscape: true, width: 700, height: 450, - + close: function() { + closeAboutModal(); + }, create: function() { $("#about-tabs").tabs({}); $(".ui-dialog-titlebar").remove(); @@ -2444,7 +2447,6 @@ $(document).ready(function() { $("#about-close").click(function() { $("#about-tabs").dialog("close"); $("div.ui-dialog").remove(); - $("#icon_about_operation").removeClass("selected"); }); } }); @@ -2746,3 +2748,9 @@ function resizeSearchHeader() { ); } } + +function closeAboutModal() { + $("#icon_about_operation").removeClass("selected"); + $("#icon_about").removeClass("selected"); + $("#icon_about_div").removeClass("selected"); +} From d4bb6e8b01ce489281705a2134bc41d27294dd26 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 15 Apr 2024 11:36:26 +0200 Subject: [PATCH 5/5] 13402-Fix margins in widget Basic chart dark theme --- pandora_console/include/lib/Dashboard/Widgets/BasicChart.php | 4 ++-- pandora_console/include/styles/pandora_black.css | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php index 0910f0ba68..cc25cb01cc 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php +++ b/pandora_console/include/lib/Dashboard/Widgets/BasicChart.php @@ -641,7 +641,7 @@ class BasicChart extends Widget $this->values['period'] = parent::getPeriod(); } - $margin = 10; + $margin = 15; $size['height'] -= $margin; $graph_height = $size['height']; $margin_top = 0; @@ -688,7 +688,7 @@ class BasicChart extends Widget ]; $graph = \grafico_modulo_sparse($params); - $output = '
'; + $output = '
'; if (str_contains($graph, 'values['colorLabel'].'; font-size:'.$this->values['sizeLabel'].'px;">'; diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index b44824ada0..b278278e32 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -2082,3 +2082,7 @@ li.agent-autocomplete-li-text-color a { background-color: var(--secondary-color); color: var(--text-color) !important; } + +.basic-chart-widget .flot-base { + background-color: unset; +}