From c346aefeaa76aa323fa7a3810a4d4c5af9486553 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 15 Mar 2023 12:41:10 +0100 Subject: [PATCH 1/2] #10685 changed in system fav, tips and Tactical group view --- pandora_console/godmode/agentes/configurar_agente.php | 6 ------ pandora_console/godmode/groups/group_list.php | 5 ++--- pandora_console/godmode/groups/tactical.php | 7 ++++--- pandora_console/include/class/TipsWindow.class.php | 11 ++++++----- pandora_console/include/styles/tactical_groups.css | 3 +++ pandora_console/include/styles/tips_window.css | 9 +++++---- pandora_console/operation/agentes/group_view.php | 2 +- pandora_console/operation/agentes/ver_agente.php | 6 ++++++ pandora_console/views/dashboard/tipsWindow.php | 7 +++++-- 9 files changed, 32 insertions(+), 24 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 385f4a5a8c..f559b4e3eb 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -827,12 +827,6 @@ if ($id_agente) { 'link' => '', 'label' => $tab_name, ], - ], - [ - 'id_element' => $id_agente, - 'url' => 'godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente, - 'label' => agents_get_alias($id_agente), - 'section' => 'Agents', ] ); } diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 6e604c7e1a..1afd26363e 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -718,7 +718,7 @@ if ($is_management_allowed === true 'tfavmenu_user', [ 'id_element' => $id_group, - 'section' => 'Tactic_group', + 'section' => 'Groups', 'id_user' => $config['id_user'], ] ); @@ -906,7 +906,6 @@ if ($tab == 'tree') { foreach ($groups as $key => $group) { $url_edit = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo']; - $url_tactical = 'index.php?sec=gagente&sec2=godmode/groups/tactical&id_group='.$group['id_grupo']; if (is_metaconsole()) { $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups'; } else { @@ -915,7 +914,7 @@ if ($tab == 'tree') { $table->data[$key][0] = $group['id_grupo']; if ($is_management_allowed === true) { - $table->data[$key][1] = ''.$group['nombre'].''; + $table->data[$key][1] = ''.$group['nombre'].''; } else { $table->data[$key][1] = $group['nombre']; } diff --git a/pandora_console/godmode/groups/tactical.php b/pandora_console/godmode/groups/tactical.php index d7984c3212..5339590bc4 100644 --- a/pandora_console/godmode/groups/tactical.php +++ b/pandora_console/godmode/groups/tactical.php @@ -72,14 +72,14 @@ if (is_metaconsole() === false) { ], [ 'link' => '', - 'label' => __('Tactic group'), + 'label' => __('Tactical group view'), ], ], [ 'id_element' => $id_group, 'url' => 'gagent&sec2=godmode/groups/tactical&id_group='.$id_group, 'label' => groups_get_name($id_group), - 'section' => 'Tactic_group', + 'section' => 'Groups', ] ); } @@ -187,7 +187,7 @@ try { [ 'id' => 'list_agents_tactical', 'class' => 'info_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', 'columns' => $columns, 'column_names' => $columnNames, 'return' => true, @@ -196,6 +196,7 @@ try { 'method' => 'getAgentsByGroup', 'id_group' => $id_group, ], + 'dom_elements' => 'lpfti', 'no_sortable_columns' => [-1], 'order' => [ 'field' => 'alias', diff --git a/pandora_console/include/class/TipsWindow.class.php b/pandora_console/include/class/TipsWindow.class.php index 6f159c8ec7..2ed452cc98 100644 --- a/pandora_console/include/class/TipsWindow.class.php +++ b/pandora_console/include/class/TipsWindow.class.php @@ -157,11 +157,12 @@ class TipsWindow View::render( 'dashboard/tipsWindow', [ - 'title' => $initialTip['title'], - 'text' => $initialTip['text'], - 'url' => $initialTip['url'], - 'files' => $initialTip['files'], - 'id' => $initialTip['id'], + 'title' => $initialTip['title'], + 'text' => $initialTip['text'], + 'url' => $initialTip['url'], + 'files' => $initialTip['files'], + 'id' => $initialTip['id'], + 'totalTips' => $this->getTotalTipsShowUser(), ] ); } diff --git a/pandora_console/include/styles/tactical_groups.css b/pandora_console/include/styles/tactical_groups.css index 383e9ef37f..1c399d1b3b 100644 --- a/pandora_console/include/styles/tactical_groups.css +++ b/pandora_console/include/styles/tactical_groups.css @@ -29,3 +29,6 @@ rect { .graph-distribution-so { margin-top: 55px; } +#list_agents_tactical_wrapper .dataTables_length { + margin-bottom: 10px; +} diff --git a/pandora_console/include/styles/tips_window.css b/pandora_console/include/styles/tips_window.css index 1fba4472d4..6e8927aa4d 100644 --- a/pandora_console/include/styles/tips_window.css +++ b/pandora_console/include/styles/tips_window.css @@ -12,7 +12,7 @@ padding: 0px; } .window { - background-image: linear-gradient(180deg, #fffce8 0%, #ffffff 100%); + background-image: white; width: 640px; width: 100%; border-radius: 5px; @@ -145,9 +145,6 @@ color: #14524f; font-weight: 600; } -#url_tip .arrow_tips { - font-size: 20px; -} span.count-round-tip { width: 6px !important; height: 6px !important; @@ -211,3 +208,7 @@ span.disable { .buttons_actions input { width: 32px; } +.hide-button { + opacity: 0; + pointer-events: none; +} diff --git a/pandora_console/operation/agentes/group_view.php b/pandora_console/operation/agentes/group_view.php index fa4d171e24..d14a3d3262 100644 --- a/pandora_console/operation/agentes/group_view.php +++ b/pandora_console/operation/agentes/group_view.php @@ -321,7 +321,7 @@ if (empty($result_groups) === false) { $link = ""; } else { $deep = groups_get_group_deep($data['_id_']); - $link = ""; + $link = ""; } $group_name = ''.ui_print_truncate_text($data['_name_'], 50).''; diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index da85b53430..b21cca1b32 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -1940,6 +1940,12 @@ if ((bool) $config['pure'] === false) { 'link' => '', 'label' => $tab_name, ], + ], + [ + 'id_element' => $id_agente, + 'url' => 'operation/agentes/ver_agente&id_agente='.$id_agente, + 'label' => agents_get_alias($id_agente), + 'section' => 'Agents', ] ); } diff --git a/pandora_console/views/dashboard/tipsWindow.php b/pandora_console/views/dashboard/tipsWindow.php index b95cf058c6..8279cfdd39 100644 --- a/pandora_console/views/dashboard/tipsWindow.php +++ b/pandora_console/views/dashboard/tipsWindow.php @@ -73,10 +73,13 @@ $output .= '

'; $output .= $text; $output .= '

'; +$link_class = 'invisible'; if (empty($url) === false && $url !== '') { - $output .= '
'.__('See more info').''; + $link_class = ''; } +$output .= ''.__('See more info').''; + $output .= ''; $output .= '
'; @@ -116,7 +119,7 @@ if ($preview === true) { '', [ 'onclick' => 'next_tip()', - 'class' => 'mini', + 'class' => ($totalTips === '1') ? 'mini hide-button' : 'mini', ], true ); From 17ba51d2bfb0a6a841e20c6fc6244c04e20375e3 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 15 Mar 2023 13:53:23 +0100 Subject: [PATCH 2/2] cluster view --- .../include/class/SnmpConsole.class.php | 5 +- pandora_console/include/styles/pandora.css | 2 +- .../operation/agentes/estado_monitores.php | 142 ++++++++++-------- .../operation/agentes/log_sources_status.php | 25 +-- pandora_console/views/cluster/list.php | 35 ++--- pandora_console/views/cluster/view.php | 93 ++++++------ 6 files changed, 158 insertions(+), 144 deletions(-) diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index f1895dfc51..3f48eb2c22 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -259,7 +259,10 @@ class SnmpConsole extends HTML 'class' => 'snmp-td', ], 'alert', - 'action', + [ + 'text' => 'action', + 'class' => 'table_action_buttons w120px', + ], [ 'text' => 'm', 'class' => 'mw60px pdd_0px', diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b504b76a44..c99e661547 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -8144,7 +8144,7 @@ div.graph div.legend table { overflow: hidden; background-color: var(--secondary-color); min-height: calc(100vh - 200px); - border: 1px solid #cacaca; + /* border: 1px solid #cacaca; */ } /* diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 57f06fd940..4edd12ee5f 100755 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -187,7 +187,7 @@ html_print_div( 'class' => 'agent_details_line', 'content' => ui_toggle( $html_toggle, - ''.__('List of modules').''.$help_not_init.ui_print_help_tip( + __('List of modules').' '.$help_not_init.ui_print_help_tip( __('To see the list of modules paginated, enable this option in the Styles Configuration.'), true ).reporting_tiny_stats( @@ -201,9 +201,9 @@ html_print_div( false, false, true, - 'box-flat agent_details_col', + '', 'white-box-content', - 'width_available' + 'box-flat white_table_graph w100p' ), ], ); @@ -543,58 +543,83 @@ function print_form_filter_monitors( $form_text = ''; $table = new stdClass(); $table->class = 'filter-table-adv'; - $table->id = 'module_filter_agent_view'; - $table->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;'; + // $table->id = 'module_filter_agent_view'; + // $table->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;'; $table->width = '100%'; - $table->cellstyle[0][0] = 'width: 0'; - $table->cellstyle[0][1] = 'width: 0'; - $table->cellstyle[0][2] = 'width: 0'; + $table->size[0] = '25%'; + $table->size[1] = '25%'; + $table->size[2] = '25%'; + $table->size[3] = '25%'; // Captions. - $table->data[0][0] = html_print_input_hidden('filter_monitors', 1, true); - $table->data[0][0] .= html_print_input_hidden('monitors_change_filter', 1, true); - $table->data[0][0] .= __('Status:'); - $table->data[0][1] = __('Free text for search (*):').ui_print_help_tip( - __('Search by module name, list matches.'), - true + $table->data[0][0] = html_print_label_input_block( + html_print_input_hidden('filter_monitors', 1, true).html_print_input_hidden( + 'monitors_change_filter', + 1, + true + ).__('Status:'), + html_print_select( + $status_list, + 'status_filter_monitor', + $status_filter_monitor, + '', + '', + 0, + true, + false, + true, + 'w100p', + false, + 'width:100%' + ) ); - $table->data[0][2] = __('Module group'); - $table->data[0][3] = __('Show in hierachy mode'); - // Inputs. - $table->data[1][0] = html_print_select( - $status_list, - 'status_filter_monitor', - $status_filter_monitor, - '', - '', - 0, - true + + $table->data[0][1] = html_print_label_input_block( + __('Free text for search (*):').ui_print_help_tip( + __('Search by module name, list matches.'), + true + ), + html_print_input_text( + 'status_text_monitor', + $status_text_monitor, + '', + '', + 100, + true + ) ); - $table->data[1][1] = html_print_input_text( - 'status_text_monitor', - $status_text_monitor, - '', - '', - 100, - true + + $table->data[0][2] = html_print_label_input_block( + __('Module group'), + html_print_select( + $rows_select, + 'status_module_group', + $status_module_group, + '', + '', + 0, + true, + false, + true, + 'w100p', + false, + 'width:100%' + ) ); - $table->data[1][2] = html_print_select( - $rows_select, - 'status_module_group', - $status_module_group, - '', - '', - 0, - true - ); - $table->data[1][3] = html_print_switch( - [ - 'name' => 'status_hierachy_mode', - 'value' => $all_events_24h, - 'onchange' => 'change_module_filter()', - 'id' => 'checkbox-status_hierachy_mode', - ] + + $table->data[0][3] = html_print_label_input_block( + __('Show in hierachy mode'), + html_print_switch( + [ + 'name' => 'status_hierachy_mode', + 'value' => $all_events_24h, + 'onchange' => 'change_module_filter()', + 'id' => 'checkbox-status_hierachy_mode', + ] + ) ); + $form_text = html_print_table($table, true); + $filtersButtons = []; $filtersButtons[] = html_print_button( @@ -603,8 +628,9 @@ function print_form_filter_monitors( false, 'filter_modules();', [ - 'icon' => 'search', - 'mode' => 'secondary mini', + 'icon' => 'search', + 'mode' => 'secondary mini', + 'style' => 'margin-left: 15px', ], true ); @@ -621,16 +647,6 @@ function print_form_filter_monitors( true ); - $table->data[1][4] = html_print_div( - [ - 'class' => 'action-buttons', - 'content' => implode('', $filtersButtons), - ], - true - ); - - $form_text .= html_print_table($table, true); - // TODO. Unused code. if ($status_filter_monitor === -1 && empty($status_text_monitor) === true && $status_module_group === -1) { $filter_hidden = true; @@ -639,4 +655,10 @@ function print_form_filter_monitors( } echo $form_text; + html_print_div( + [ + 'class' => 'action-buttons-right-forced', + 'content' => implode('', $filtersButtons), + ] + ); } diff --git a/pandora_console/operation/agentes/log_sources_status.php b/pandora_console/operation/agentes/log_sources_status.php index 9e4dd50518..bab810fa5f 100644 --- a/pandora_console/operation/agentes/log_sources_status.php +++ b/pandora_console/operation/agentes/log_sources_status.php @@ -94,6 +94,19 @@ if (!empty($table->data)) { echo '
'; html_print_table($table); echo '
'; + $html_content = ob_get_clean(); + // Create controlled toggle content. + ui_toggle( + $html_content, + __('Log sources status'), + 'log_sources_status', + !$log_sources_defined, + false, + '', + 'white_table_graph_content no-padding-imp', + 'white-box-content', + 'box-flat white_thable_graph mrgn_top_30px' + ); } else { ui_print_info_message(['no_close' => true, 'message' => __('No log sources found') ]); $log_sources_defined = false; @@ -109,18 +122,6 @@ html_print_input_hidden('redirect_search', 1, false); echo ''; -$html_content = ob_get_clean(); - -// Create controlled toggle content. -ui_toggle( - $html_content, - __('Log sources status'), - 'log_sources_status', - !$log_sources_defined, - false, - '', - 'white_table_graph_content no-padding-imp' -); ?> diff --git a/pandora_console/views/cluster/list.php b/pandora_console/views/cluster/list.php index c72f1752a1..4a4db2f36f 100644 --- a/pandora_console/views/cluster/list.php +++ b/pandora_console/views/cluster/list.php @@ -50,7 +50,7 @@ try { 'known_status', [ 'text' => 'options', - 'class' => 'action_buttons', + 'class' => 'table_action_buttons', ], ]; @@ -102,6 +102,7 @@ try { ], ], ], + 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', ] ); } catch (Exception $e) { @@ -109,24 +110,20 @@ try { } if (check_acl($config['id_user'], 0, 'AW')) { - HTML::printForm( + $buttons[] = html_print_submit_button( + __('New cluster'), + 'submit', + false, [ - 'form' => [ - 'method' => 'POST', - 'action' => ui_get_full_url($model->url.'&op=new'), - ], - 'inputs' => [ - [ - 'class' => 'w100p', - 'arguments' => [ - 'name' => 'submit', - 'label' => __('New cluster'), - 'type' => 'submit', - 'attributes' => 'class="sub next"', - 'return' => true, - ], - ], - ], - ] + 'class' => 'sub ok', + 'icon' => 'next', + ], + true ); + echo '
'; + html_print_action_buttons( + implode('', $buttons), + ['type' => 'form_action'] + ); + echo '
'; } diff --git a/pandora_console/views/cluster/view.php b/pandora_console/views/cluster/view.php index 775ca3e30a..a15bb1584c 100644 --- a/pandora_console/views/cluster/view.php +++ b/pandora_console/views/cluster/view.php @@ -358,17 +358,13 @@ $map_manager = new NetworkMap( * */ -$table_events = '
'; -$table_events .= '
'; -$table_events .= html_print_image( - 'images/arrow_down_green.png', - true -); -$table_events .= ''; +$table_events = '
'; +$table_events .= '
'; +$table_events .= ''; $table_events .= __('Events (Last 24h)'); -$table_events .= ''; +$table_events .= ''; $table_events .= '
'; -$table_events .= '
'; +$table_events .= '
'; $table_events .= graph_graphic_agentevents( $cluster->agent()->id_agente(), 95, @@ -384,29 +380,34 @@ $table_events .= '
'; ?>
-
-
- -
-
-
- -
- +
+
+
+ +
+
+
+ +
+ +
+
+
+
-
- -
+
+ +
+
-
printMap(); ?> @@ -414,10 +415,6 @@ $table_events .= '
';
-
- -
-
agent()->id_agente(); @@ -427,28 +424,22 @@ require_once $config['homedir'].'/operation/agentes/estado_monitores.php'; [ - 'action' => $model->url.'&op=view&id='.$cluster->id(), - 'method' => 'POST', - ], - 'inputs' => [ - [ - 'arguments' => [ - 'name' => 'submit', - 'label' => __('Reload'), - 'type' => 'submit', - 'attributes' => 'class="sub cancel"', - 'return' => true, - ], - ], - ], + 'class' => 'sub ok', + 'icon' => 'next', ], - false + true ); - -echo '
'; +echo '
'; +html_print_action_buttons( + implode('', $buttons), + ['type' => 'form_action'] +); +echo '
'; // Print always go back button. HTML::printForm($model->getGoBackForm(), false);