From 76d8918a4e5e33c87c27604e42097c176bf247c2 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Mon, 21 Mar 2022 10:04:11 +0100 Subject: [PATCH] fixed CV in console mobile metaconsole #8676 --- pandora_console/include/functions_ui.php | 3 +++ .../include/javascript/pandora_dashboards.js | 6 +++++ pandora_console/mobile/operation/events.php | 26 ++++++++++++------- .../operation/visual_console/public_view.php | 6 +++++ .../operation/visual_console/view.php | 9 +++++-- 5 files changed, 38 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 95abe0ede1..e25a5d74bb 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4640,12 +4640,15 @@ function ui_print_page_header( } $buffer .= ''; + $buffer .= ''; if (empty($alias)) { $buffer .= ui_print_truncate_text($title, $numChars); } else { $buffer .= ui_print_truncate_text($alias, $numChars); } + $buffer .= ''; + if ($modal && !enterprise_installed()) { $buffer .= "
diff --git a/pandora_console/include/javascript/pandora_dashboards.js b/pandora_console/include/javascript/pandora_dashboards.js index 1a0eaa6c28..f7599362d1 100644 --- a/pandora_console/include/javascript/pandora_dashboards.js +++ b/pandora_console/include/javascript/pandora_dashboards.js @@ -1306,6 +1306,12 @@ function dashboardLoadVC(settings) { parent.removeChild(div); } } + + // View title. + var title = document.querySelector(".ui-title"); + if (title !== null) { + title.textContent = visualConsole.props.name; + } } }, error: function(error) { diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index cd2616ebb4..d893cb6e51 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -734,23 +734,29 @@ class Events // --------------Fill the SQL POST------------------------------- $sql_post = ' WHERE 1=1 '; - switch ($this->status) { - case 0: - case 1: - case 2: - $sql_post .= ' AND estado = '.$this->status; - break; + if ($this->status != null) { + switch ($this->status) { + case 0: + case 1: + case 2: + $sql_post .= ' AND estado = '.$this->status; + break; - case 3: - $sql_post .= ' AND (estado = 0 OR estado = 2)'; - break; + case 3: + $sql_post .= ' AND (estado = 0 OR estado = 2)'; + break; + + default: + // Not posible. + break; + } } if ($this->free_search != '') { $sql_post .= " AND evento LIKE '%".io_safe_input($this->free_search)."%'"; } - if ($this->severity != -1) { + if ($this->severity != null && $this->severity != -1) { switch ($this->severity) { case EVENT_CRIT_WARNING_OR_CRITICAL: $sql_post .= ' AND (criticity = '.EVENT_CRIT_WARNING.' OR diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 1608c65a26..173fa76083 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -221,6 +221,12 @@ $visualConsoleItems = VisualConsole::getItemsFromDB( if (title !== null) { title.textContent = newProps.name; } + + // Fullscreen Meta view title. + var titleMeta = document.querySelector("div.vc-title-meta"); + if (titleMeta !== null) { + titleMeta.textContent = newProps.name; + } } // Change the links. diff --git a/pandora_console/operation/visual_console/view.php b/pandora_console/operation/visual_console/view.php index 45be07fbcb..9611c99dbb 100644 --- a/pandora_console/operation/visual_console/view.php +++ b/pandora_console/operation/visual_console/view.php @@ -611,7 +611,7 @@ ui_require_css_file('form'); if (prevProps && prevProps.name != newProps.name) { // View title. var title = document.querySelector( - "div#menu_tab_frame_view > div#menu_tab_left span" + ".breadcrumbs-title" ); if (title !== null) { title.textContent = newProps.name; @@ -621,7 +621,12 @@ ui_require_css_file('form'); if (fullscreenTitle !== null) { fullscreenTitle.textContent = newProps.name; } - // TODO: Change the metaconsole title. + + // Fullscreen Meta view title. + var fullscreenTitleMeta = document.querySelector("div.vc-title-meta"); + if (fullscreenTitleMeta !== null) { + fullscreenTitleMeta.textContent = newProps.name; + } } // Change the links.