diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 6dbde75c14..79e7ac2d75 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.775-240108 +Version: 7.0NG.775-240118 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index e5fb421ee7..c1029f651b 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.775-240108" +pandora_version="7.0NG.775-240118" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 329b7cd4eb..c4b788fe46 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.775'; -use constant AGENT_BUILD => '240108'; +use constant AGENT_BUILD => '240118'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 78227f9722..03bec971e3 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240108 +%define release 240118 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index 223f7ddd3a..bfcb50e59f 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240108 +%define release 240118 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 985dc94ee3..1cf8be22e9 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240108 +%define release 240118 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index c012e57986..f16c07fc1e 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240108 +%define release 240118 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a2fd40c6b9..f6d4e075f5 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.775 -%define release 240108 +%define release 240118 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 549b940b16..e91df83438 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.775" -PI_BUILD="240108" +PI_BUILD="240118" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 010569a44e..a278d97f8d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240108} +{240118} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index c0a23b2b3c..34a6dd3be8 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.775 Build 240108") +#define PANDORA_VERSION ("7.0NG.775 Build 240118") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 41b4047b80..7763dcb321 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.775(Build 240108))" + VALUE "ProductVersion", "(7.0NG.775(Build 240118))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 44718a8689..bd76e0003c 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.775-240108 +Version: 7.0NG.775-240118 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index ea868b70ae..81f525de04 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.775-240108" +pandora_version="7.0NG.775-240118" package_pear=0 package_pandora=1 diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 82da1a66dd..5ad89d8d31 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -397,21 +397,23 @@ echo sprintf('
', $menuTypeClass); $modal_box .= ''.__('Join discord community').''; $modal_box .= '
'; - $modal_help = html_print_div( - [ - 'id' => 'modal-help-content', - 'content' => html_print_image( - 'images/help@header.svg', - true, - [ - 'title' => __('Help'), - 'class' => 'main_menu_icon bot invert_filter', - 'alt' => 'user', - ] - ).$modal_box, - ], - true, - ); + if ($config['activate_feedback'] === '1') { + $modal_help = html_print_div( + [ + 'id' => 'modal-help-content', + 'content' => html_print_image( + 'images/help@header.svg', + true, + [ + 'title' => __('Help'), + 'class' => 'main_menu_icon bot invert_filter', + 'alt' => 'user', + ] + ).$modal_box, + ], + true, + ); + } // User. diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 2c6661c1f6..a77e63b95b 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -770,11 +770,14 @@ $("#conf_wizard").click(function() { modal: { title: "", cancel: '', - ok: '' + ok: '', + overlay: true, + overlayExtraClass: 'welcome-overlay', }, onshow: { page: 'include/ajax/welcome_window', method: 'loadWelcomeWindow', + width: 1000, }, oncancel: { page: 'include/ajax/welcome_window', @@ -792,6 +795,34 @@ $("#conf_wizard").click(function() { } }) } + }, + onload: () => { + $(document).ready(function () { + var buttonpane = $("div[aria-describedby='welcome_modal_window'] .ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix"); + $(buttonpane).append(` +
+ + +
+ `); + + var closeWizard = $("button.close-wizard-button"); + + $(closeWizard).click(function (e) { + var close = $("div[aria-describedby='welcome_modal_window'] button.sub.ok.submit-next.ui-button"); + var cancel = $("div[aria-describedby='welcome_modal_window'] button.sub.upd.submit-cancel.ui-button"); + var checkbox = $("div[aria-describedby='welcome_modal_window'] .welcome-wizard-do-not-show:checked").length; + + if (checkbox === 1) { + $(cancel).click(); + } else { + $(close).click() + } + }); + }); } }); }); diff --git a/pandora_console/godmode/modules/manage_nc_groups.php b/pandora_console/godmode/modules/manage_nc_groups.php index d5540d2472..e7ceff1f01 100644 --- a/pandora_console/godmode/modules/manage_nc_groups.php +++ b/pandora_console/godmode/modules/manage_nc_groups.php @@ -394,11 +394,11 @@ html_print_action_buttons( $('[id^=checkbox-all_delete]').change(function(){ if ($("#checkbox-all_delete").prop("checked")) { $('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected'); - $(".check_delete").prop("checked", true); + $(".custom_checkbox_input").prop("checked", true); } else{ $('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected'); - $(".check_delete").prop("checked", false); + $(".custom_checkbox_input").prop("checked", false); } }); }); diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index 0256c28f92..c4da379ebd 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -30,7 +30,7 @@ if (!$report_w && !$report_m) { require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_groups.php'; - +ui_require_css_file('custom_graph'); $editGraph = (bool) get_parameter('edit_graph', 0); $action = get_parameter('action', ''); @@ -41,113 +41,6 @@ if (isset($_GET['get_agent'])) { } } -switch ($action) { - case 'sort_items': - $resultOperationDB = null; - $position_to_sort = (int) get_parameter('position_to_sort', 1); - $ids_serialize = (string) get_parameter('ids_items_to_sort', ''); - $move_to = (string) get_parameter('move_to', 'after'); - - $countItems = db_get_sql( - ' - SELECT COUNT(id_gs) - FROM tgraph_source - WHERE id_graph = '.$id_graph - ); - - if (($countItems < $position_to_sort) || ($position_to_sort < 1)) { - $resultOperationDB = false; - } else if (!empty($ids_serialize)) { - $ids = explode('|', $ids_serialize); - $items = db_get_all_rows_sql( - 'SELECT id_gs, `field_order` - FROM tgraph_source - WHERE id_graph = '.$id_graph.' - ORDER BY `field_order`' - ); - - if ($items === false) { - $items = []; - } - - - // Clean the repeated order values. - $order_temp = 1; - foreach ($items as $item) { - db_process_sql_update( - 'tgraph_source', - ['`field_order`' => $order_temp], - ['id_gs' => $item['id_rc']] - ); - - $order_temp++; - } - - $items = db_get_all_rows_sql( - 'SELECT id_gs, `field_order` - FROM tgraph_source - WHERE id_graph = '.$id_graph.' - ORDER BY `field_order`' - ); - - if ($items === false) { - $items = []; - } - - - - $temp = []; - - $temp = []; - foreach ($items as $item) { - // Remove the contents from the block to sort. - if (array_search($item['id_gs'], $ids) === false) { - $temp[$item['field_order']] = $item['id_gs']; - } - } - - $items = $temp; - - - - $sorted_items = []; - foreach ($items as $pos => $id_unsort) { - if ($pos == $position_to_sort) { - if ($move_to == 'after') { - $sorted_items[] = $id_unsort; - } - - foreach ($ids as $id) { - $sorted_items[] = $id; - } - - if ($move_to != 'after') { - $sorted_items[] = $id_unsort; - } - } else { - $sorted_items[] = $id_unsort; - } - } - - $items = $sorted_items; - - - - foreach ($items as $order => $id) { - db_process_sql_update( - 'tgraph_source', - ['`field_order`' => ($order + 1)], - ['id_gs' => $id] - ); - } - - $resultOperationDB = true; - } else { - $resultOperationDB = false; - } - break; -} - if ($editGraph) { $graphRows = db_get_all_rows_sql( 'SELECT t1.*, @@ -257,41 +150,6 @@ $table->data[0][1] = html_print_label_input_block( ); -$SortItems = "
"; -$SortItems .= html_print_table($table, true); -$SortItems .= html_print_input_hidden('action', 'sort_items', true); -$SortItems .= html_print_div( - [ - 'class' => 'action-buttons', - 'content' => html_print_submit_button( - __('Sort'), - 'srcbutton', - false, - [ - 'class' => 'mini', - 'icon' => 'search', - 'mode' => 'secondary', - ], - true - ), - ], - true -); -$SortItems .= '
'; - -ui_toggle( - $SortItems, - ''.__('Sort items').'', - '', - '', - false, - false, - '', - 'white-box-content no_border', - 'filter-datatable-main box-flat white_table_graph max_floating_element_size' -); - - // Configuration form. echo ''; echo "
"; @@ -300,10 +158,11 @@ echo "'; echo ''; echo ''; @@ -340,6 +199,7 @@ echo ''; // Modules table. if ($count_module_array > 0) { echo "
'.html_print_input( [ - 'type' => 'select_multiple_modules_filtered', - 'uniqId' => 'modules', - 'class' => 'flex flex-row', - 'searchBar' => true, + 'type' => 'select_multiple_modules_filtered', + 'uniqId' => 'modules', + 'class' => 'flex flex-row', + 'searchBar' => false, + 'placeholderAgents' => __('Search agent name'), ] ).'
"; + echo ''; echo ' @@ -348,6 +208,8 @@ if ($count_module_array > 0) { '; + echo ''; + echo ''; $color = 0; for ($a = 0; $a < $count_module_array; $a++) { // Calculate table line color. @@ -359,7 +221,7 @@ if ($count_module_array > 0) { $color = 1; } - echo ""; + echo ""; echo "'; echo "'; @@ -410,9 +272,30 @@ if ($count_module_array > 0) { echo ''; - echo ''; @@ -420,6 +303,8 @@ if ($count_module_array > 0) { echo ''; } + echo ''; + echo '
'.__('P.').' '.__('Agent').''.__('Weight').' '.__('Delete').' '.__('Sort').'
$position_array[$a]
$position_array[$a]".$agent_array[$a].'"; echo modules_get_agentmodule_name($module_array[$a]).''; + echo ''; - echo html_print_checkbox_extended('sorted_items[]', $idgs_array[$a], false, false, '', 'class="selected_check"', true); + echo html_print_input_image( + 'up', + 'images/arrow-up-white.png', + 'up', + ($config['style'] !== 'pandora_black') ? 'filter: invert(100%)' : '', + true, + [ + 'class' => 'invert_filter main_menu_icon', + 'onclick' => 'reorder(\'up\', \''.$idgs_array[$a].'\', this)', + ], + ); + echo html_print_input_image( + 'down', + 'images/arrow-down-white.png', + 'down', + ($config['style'] !== 'pandora_black') ? 'filter: invert(100%)' : '', + true, + [ + 'class' => 'invert_filter main_menu_icon', + 'onclick' => 'reorder(\'down\', \''.$idgs_array[$a].'\', this)', + ] + ); echo '
'; } @@ -482,4 +367,65 @@ function added_ids_sorted_items_to_hidden_input() { return true; } } + + +function reorder(action, idElement, element) { + var tr = $(element).parent().parent(); + switch (action) { + case "up": + changePosition(action, idElement) + .then((data) => { + if(data.success) { + $(tr).find('.position').html(parseInt($(tr).find('.position').html()) - 1); + $($(tr).prev()).find('.position').html(parseInt($($(tr).prev()).find('.position').html()) + 1); + $(tr).prev().insertAfter(tr); + } + }) + .catch((err) => { + console.log(err); + }) + break; + + case "down": + changePosition(action, idElement) + .then((data) => { + if(data.success) { + $(tr).find('.position').html(parseInt($(tr).find('.position').html()) + 1); + $($(tr).next()).find('.position').html(parseInt(($(tr).next()).find('.position').html()) - 1); + $(tr).next().insertBefore(tr); + } + }) + .catch((err) => { + console.log(err); + }) + break; + + default: + break; + } +} + +function changePosition(order, idElement) { + return new Promise(function(resolve, reject) { + $.ajax({ + method: "POST", + url: "", + dataType: "json", + data: { + page: "include/ajax/graph.ajax", + sort_items: 1, + order, + id_graph: , + id: idElement + }, + success: function(data) { + resolve(data); + }, + error: function(error) { + reject(error); + } + }); + }); +} + diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 7524b64861..a39cff30b7 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -247,7 +247,7 @@ if ($add_module === true) { $id_agent_modules = db_get_all_rows_sql($sql); - if (count($id_agent_modules) > 0 && $id_agent_modules != '') { + if (is_array($id_agent_modules) === true && count($id_agent_modules) > 0 && $id_agent_modules != '') { $sql_order = sprintf( 'SELECT `field_order` FROM tgraph_source diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index c51c0476d3..8a78de9592 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -521,7 +521,7 @@ $(document).ready (function () { function (data) { $(".white-box-content").html(data); - $("#submit-add").click(function (e) { + $("#button-add").click(function (e) { add_credential_boxes(); }); @@ -550,7 +550,7 @@ $(document).ready (function () { $(".white-box-content").html(data2); // Insert credential - $("#submit-add").click(function (e) { + $("#button-add").click(function (e) { save_credential_boxes(); }) }, @@ -609,7 +609,7 @@ $(document).ready (function () { function (data) { $(".white-box-content").html(data); - $("#submit-update").click(function (e) { + $("#button-update").click(function (e) { update_credential_boxes(datas); }); }, diff --git a/pandora_console/godmode/setup/setup_ITSM.php b/pandora_console/godmode/setup/setup_ITSM.php index 012d80f849..313e6763c0 100644 --- a/pandora_console/godmode/setup/setup_ITSM.php +++ b/pandora_console/godmode/setup/setup_ITSM.php @@ -559,7 +559,7 @@ $table_cr_settings->data[4][0] = html_print_label_input_block( // Print. echo '
'; -echo ''; +echo ''; html_print_image( 'images/pandoraITSM_logo.png', false, @@ -570,8 +570,8 @@ echo '
'; echo '
'; echo __('Pandora ITSM'); echo '
'; -echo '
'; -echo 'https://pandorafms.com/es/itsm/'; +echo ''; +echo 'https://pandorafms.com/itsm/'; echo ''; echo '
'; diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index dbca522db4..09835fe150 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -424,12 +424,15 @@ if ($create_user === true) { $values['data_section'] = $dashboard; } else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) { $values['data_section'] = $visual_console; - } else if ($values['section'] === HOME_SCREEN_OTHER) { - $values['data_section'] = get_parameter('data_section_other'); - } else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { + } else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { $values['data_section'] = get_parameter('data_section'); } + if (is_metaconsole() === true) { + $values['metaconsole_section'] = $values['section']; + $values['metaconsole_data_section'] = $values['data_section']; + } + // $values['section'] = $homeScreenValues[$values['section']]; if (enterprise_installed() === true) { $values['force_change_pass'] = 1; @@ -724,9 +727,7 @@ if ($update_user) { $values['data_section'] = $dashboard; } else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) { $values['data_section'] = $visual_console; - } else if ($values['section'] === HOME_SCREEN_OTHER) { - $values['data_section'] = get_parameter('data_section_other'); - } else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { + } else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { $values['data_section'] = get_parameter('data_section'); } diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 2f8aecd47e..7a5abb8503 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -84,8 +84,7 @@ $customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select( // Home screen. Visual consoles. $customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%'); // Home screen. External link and Other. -$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section_external', $user_info['data_section'], '', 60, 255, true); -$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section_other', $user_info['data_section'], '', 60, 255, true); +$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 400, true); $layouts = visual_map_get_user_layouts($config['id_user'], true); $layouts_aux = []; diff --git a/pandora_console/images/check-white.svg b/pandora_console/images/check-white.svg new file mode 100644 index 0000000000..e7863cf1ba --- /dev/null +++ b/pandora_console/images/check-white.svg @@ -0,0 +1,21 @@ + + + F1630B1D-C694-489C-8C8F-E98AF57D4F04 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pandora_console/images/discovery/pandorafms.mongodb.png b/pandora_console/images/discovery/pandorafms.mongodb.png index 1042463eda..37f3b2d542 100644 Binary files a/pandora_console/images/discovery/pandorafms.mongodb.png and b/pandora_console/images/discovery/pandorafms.mongodb.png differ diff --git a/pandora_console/images/discovery/pandorafms.ovh.png b/pandora_console/images/discovery/pandorafms.ovh.png index 69eddb9a31..37910c38aa 100644 Binary files a/pandora_console/images/discovery/pandorafms.ovh.png and b/pandora_console/images/discovery/pandorafms.ovh.png differ diff --git a/pandora_console/images/welcome-wizard-image.png b/pandora_console/images/welcome-wizard-image.png new file mode 100644 index 0000000000..aba9647c54 Binary files /dev/null and b/pandora_console/images/welcome-wizard-image.png differ diff --git a/pandora_console/include/ajax/graph.ajax.php b/pandora_console/include/ajax/graph.ajax.php index 6ea76f373b..2db3a72912 100644 --- a/pandora_console/include/ajax/graph.ajax.php +++ b/pandora_console/include/ajax/graph.ajax.php @@ -17,6 +17,8 @@ $save_custom_graph = (bool) get_parameter('save_custom_graph'); $print_custom_graph = (bool) get_parameter('print_custom_graph', false); $print_sparse_graph = (bool) get_parameter('print_sparse_graph'); $get_graphs = (bool) get_parameter('get_graphs_container'); +$sort_items = (bool) get_parameter('sort_items'); + $width = get_parameter('width', 0); $height = get_parameter('height', 0); @@ -337,3 +339,104 @@ if ($get_graphs) { return; } } + + +if ($sort_items === true) { + $order = (string) get_parameter('order'); + $id = (string) get_parameter('id', ''); + $idGraph = (string) get_parameter('id_graph', ''); + $total = db_get_num_rows('SELECT * FROM tgraph_source WHERE id_graph = '.$idGraph.''); + $item = db_get_row_sql( + 'SELECT id_gs, field_order + FROM tgraph_source + WHERE id_gs = '.$id.' + ORDER BY field_order' + ); + + switch ($order) { + case 'up': + if (($item['field_order'] - 1) < 1) { + echo json_encode(['success' => false]); + return; + } + + $prevItem = db_get_row_sql( + 'SELECT id_gs, field_order + FROM tgraph_source + WHERE id_graph = '.$idGraph.' + AND field_order = '.($item['field_order'] - 1).' + ORDER BY field_order' + ); + + db_process_sql_begin(); + + $resultItem = db_process_sql_update( + 'tgraph_source', + ['field_order' => ($item['field_order'] - 1)], + ['id_gs' => $item['id_gs']], + false + ); + $resultPrevItem = db_process_sql_update( + 'tgraph_source', + ['field_order' => ($prevItem['field_order'] + 1)], + ['id_gs' => $prevItem['id_gs']], + false + ); + + if ($resultItem !== false && $resultPrevItem !== false) { + db_process_sql_commit(); + echo json_encode(['success' => true]); + return; + } else { + db_process_sql_rollback(); + echo json_encode(['success' => false]); + return; + } + break; + + case 'down': + if (($item['field_order'] + 1) > $total) { + echo json_encode(['success' => false]); + return; + } + + $nextItem = db_get_row_sql( + 'SELECT id_gs, field_order + FROM tgraph_source + WHERE id_graph = '.$idGraph.' + AND field_order = '.($item['field_order'] + 1).' + ORDER BY field_order' + ); + + + db_process_sql_begin(); + + $resultItem = db_process_sql_update( + 'tgraph_source', + ['field_order' => ($item['field_order'] + 1)], + ['id_gs' => $item['id_gs']], + false + ); + $resultNextItem = db_process_sql_update( + 'tgraph_source', + ['field_order' => ($nextItem['field_order'] - 1)], + ['id_gs' => $nextItem['id_gs']], + false + ); + + if ($resultItem !== false && $resultNextItem !== false) { + db_process_sql_commit(); + echo json_encode(['success' => true]); + return; + } else { + db_process_sql_rollback(); + echo json_encode(['success' => false]); + return; + } + break; + + default: + echo json_encode(['success' => false]); + break; + } +} diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 76a6458f32..3141272352 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -816,8 +816,6 @@ function update_user(string $id_user, array $values) $values['metaconsole_data_section'] = $values['data_section']; $values['metaconsole_default_event_filter'] = $values['default_event_filter']; unset($values['id_skin']); - unset($values['section']); - unset($values['data_section']); unset($values['default_event_filter']); } } diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 92552242f3..f60c4dc241 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -928,7 +928,9 @@ class ConsoleSupervisor false ); - if ($prev !== false + if ($data['type'] === 'NOTIF.LOG.ALERT' && $prev !== false) { + return; + } else if ($prev !== false && (time() - $prev['timestamp']) > $max_age ) { // Clean previous notification. diff --git a/pandora_console/include/class/WelcomeWindow.class.php b/pandora_console/include/class/WelcomeWindow.class.php index 4c72046548..378a194e32 100644 --- a/pandora_console/include/class/WelcomeWindow.class.php +++ b/pandora_console/include/class/WelcomeWindow.class.php @@ -156,11 +156,14 @@ class WelcomeWindow extends Wizard modal: { title: "", cancel: '', - ok: '' + ok: '', + overlay: true, + overlayExtraClass: 'welcome-overlay', }, onshow: { page: 'ajaxController; ?>', method: 'loadWelcomeWindow', + width: 1000, }, oncancel: { page: 'ajaxController; ?>', @@ -178,6 +181,34 @@ class WelcomeWindow extends Wizard } }) } + }, + onload: () => { + $(document).ready(function () { + var buttonpane = $("div[aria-describedby='welcome_modal_window'] .ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix"); + $(buttonpane).append(` +
+ + +
+ `); + + var closeWizard = $("button.close-wizard-button"); + + $(closeWizard).click(function (e) { + var close = $("div[aria-describedby='welcome_modal_window'] button.sub.ok.submit-next.ui-button"); + var cancel = $("div[aria-describedby='welcome_modal_window'] button.sub.upd.submit-cancel.ui-button"); + var checkbox = $("div[aria-describedby='welcome_modal_window'] .welcome-wizard-do-not-show:checked").length; + + if (checkbox === 1) { + $(cancel).click(); + } else { + $(close).click() + } + }); + }); } }); @@ -412,11 +443,11 @@ class WelcomeWindow extends Wizard $inputs[] = [ 'wrapper' => 'div', 'block_id' => 'div_diagnosis', - 'class' => 'flex-row flex-items-center w98p ', + 'class' => 'flex-row flex-items-center ', 'direct' => 1, 'block_content' => [ [ - 'label' => __('Post-installation status diagnostic'), + 'label' => __('This is your post-installation status diagnostic:'), 'arguments' => [ 'class' => 'first_lbl', 'name' => 'lbl_diagnosis', @@ -434,7 +465,7 @@ class WelcomeWindow extends Wizard 'direct' => 1, 'block_content' => [ [ - 'label' => __('Warp Update registration'), + 'label' => ''.__('Warp Update registration'), 'arguments' => [ 'class' => 'first_lbl', 'name' => 'lbl_update_manager', @@ -443,7 +474,7 @@ class WelcomeWindow extends Wizard ], [ 'arguments' => [ - 'label' => '', + 'label' => __('Cancel'), 'type' => 'button', 'attributes' => [ 'class' => (empty($btn_update_manager_class) === false) ? $btn_update_manager_class : 'invisible_important', @@ -462,7 +493,7 @@ class WelcomeWindow extends Wizard 'direct' => 1, 'block_content' => [ [ - 'label' => __('Default mail to send alerts'), + 'label' => ''.__('Default mail to send alerts'), 'arguments' => [ 'class' => 'first_lbl', 'name' => 'lbl_create_agent', @@ -471,7 +502,7 @@ class WelcomeWindow extends Wizard ], [ 'arguments' => [ - 'label' => '', + 'label' => __('Cancel'), 'type' => 'button', 'attributes' => [ 'class' => (empty($btn_configure_mail_class) === false) ? $btn_configure_mail_class : 'invisible_important', @@ -490,7 +521,7 @@ class WelcomeWindow extends Wizard 'direct' => 1, 'block_content' => [ [ - 'label' => __('All servers running'), + 'label' => ''.__('All servers running'), 'arguments' => [ 'class' => 'first_lbl', 'name' => 'lbl_servers_up', @@ -499,7 +530,7 @@ class WelcomeWindow extends Wizard ], [ 'arguments' => [ - 'label' => '', + 'label' => __('Cancel'), 'type' => 'button', 'attributes' => [ 'class' => (empty($btn_servers_up_class) === false) ? $btn_servers_up_class : 'invisible_important', @@ -518,7 +549,7 @@ class WelcomeWindow extends Wizard 'direct' => 1, 'block_content' => [ [ - 'label' => __('Enterprise licence valid'), + 'label' => ''.__('Enterprise licence valid'), 'arguments' => [ 'class' => 'first_lbl', 'name' => 'lbl_license_valid', @@ -527,7 +558,7 @@ class WelcomeWindow extends Wizard ], [ 'arguments' => [ - 'label' => '', + 'label' => __('Cancel'), 'type' => 'button', 'attributes' => [ 'class' => (empty($btn_license_valid_class) === false) ? $btn_license_valid_class : 'invisible_important', @@ -567,7 +598,7 @@ class WelcomeWindow extends Wizard $inputs[] = [ 'wrapper' => 'div', 'block_id' => 'div_task_todo', - 'class' => 'flex-row flex-items-center w98p', + 'class' => 'flex-row flex-items-center', 'direct' => 1, 'block_content' => [ [ @@ -591,7 +622,7 @@ class WelcomeWindow extends Wizard $inputs[] = [ 'wrapper' => 'div', 'block_id' => 'div_wizard_agent', - 'class' => 'flex space-between w98p', + 'class' => 'flex space-between', 'direct' => 1, 'block_content' => [ [ @@ -599,7 +630,7 @@ class WelcomeWindow extends Wizard 'type' => 'select', 'fields' => $fields, 'name' => 'task_to_perform', - 'selected' => '', + 'selected' => 'check_net', 'return' => true, 'nothing' => \__('Please select one'), 'nothing_value' => '', @@ -630,6 +661,24 @@ class WelcomeWindow extends Wizard $output .= $this->loadJS($flag_task); echo $output; + + echo ' +
+ + +
+ '; ?>