Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Pablo Aragon 2023-03-15 15:58:34 +01:00
commit 797f43ff3c
15 changed files with 190 additions and 168 deletions

View File

@ -827,12 +827,6 @@ if ($id_agente) {
'link' => '', 'link' => '',
'label' => $tab_name, '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',
] ]
); );
} }

View File

@ -718,7 +718,7 @@ if ($is_management_allowed === true
'tfavmenu_user', 'tfavmenu_user',
[ [
'id_element' => $id_group, 'id_element' => $id_group,
'section' => 'Tactic_group', 'section' => 'Groups',
'id_user' => $config['id_user'], 'id_user' => $config['id_user'],
] ]
); );
@ -906,7 +906,6 @@ if ($tab == 'tree') {
foreach ($groups as $key => $group) { foreach ($groups as $key => $group) {
$url_edit = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo']; $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()) { if (is_metaconsole()) {
$url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups'; $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo'].'&tab=groups';
} else { } else {
@ -915,7 +914,7 @@ if ($tab == 'tree') {
$table->data[$key][0] = $group['id_grupo']; $table->data[$key][0] = $group['id_grupo'];
if ($is_management_allowed === true) { if ($is_management_allowed === true) {
$table->data[$key][1] = '<a href="'.$url_tactical.'">'.$group['nombre'].'</a>'; $table->data[$key][1] = '<a href="'.$url_edit.'">'.$group['nombre'].'</a>';
} else { } else {
$table->data[$key][1] = $group['nombre']; $table->data[$key][1] = $group['nombre'];
} }

View File

@ -72,14 +72,14 @@ if (is_metaconsole() === false) {
], ],
[ [
'link' => '', 'link' => '',
'label' => __('Tactic group'), 'label' => __('Tactical group view'),
], ],
], ],
[ [
'id_element' => $id_group, 'id_element' => $id_group,
'url' => 'gagent&sec2=godmode/groups/tactical&id_group='.$id_group, 'url' => 'gagent&sec2=godmode/groups/tactical&id_group='.$id_group,
'label' => groups_get_name($id_group), 'label' => groups_get_name($id_group),
'section' => 'Tactic_group', 'section' => 'Groups',
] ]
); );
} }
@ -187,7 +187,7 @@ try {
[ [
'id' => 'list_agents_tactical', 'id' => 'list_agents_tactical',
'class' => 'info_table', 'class' => 'info_table',
'style' => 'width: 100%', 'style' => 'width: 99%',
'columns' => $columns, 'columns' => $columns,
'column_names' => $columnNames, 'column_names' => $columnNames,
'return' => true, 'return' => true,
@ -196,6 +196,7 @@ try {
'method' => 'getAgentsByGroup', 'method' => 'getAgentsByGroup',
'id_group' => $id_group, 'id_group' => $id_group,
], ],
'dom_elements' => 'lpfti',
'no_sortable_columns' => [-1], 'no_sortable_columns' => [-1],
'order' => [ 'order' => [
'field' => 'alias', 'field' => 'alias',

View File

@ -259,7 +259,10 @@ class SnmpConsole extends HTML
'class' => 'snmp-td', 'class' => 'snmp-td',
], ],
'alert', 'alert',
'action', [
'text' => 'action',
'class' => 'table_action_buttons w120px',
],
[ [
'text' => 'm', 'text' => 'm',
'class' => 'mw60px pdd_0px', 'class' => 'mw60px pdd_0px',

View File

@ -157,11 +157,12 @@ class TipsWindow
View::render( View::render(
'dashboard/tipsWindow', 'dashboard/tipsWindow',
[ [
'title' => $initialTip['title'], 'title' => $initialTip['title'],
'text' => $initialTip['text'], 'text' => $initialTip['text'],
'url' => $initialTip['url'], 'url' => $initialTip['url'],
'files' => $initialTip['files'], 'files' => $initialTip['files'],
'id' => $initialTip['id'], 'id' => $initialTip['id'],
'totalTips' => $this->getTotalTipsShowUser(),
] ]
); );
} }

View File

@ -8144,7 +8144,7 @@ div.graph div.legend table {
overflow: hidden; overflow: hidden;
background-color: var(--secondary-color); background-color: var(--secondary-color);
min-height: calc(100vh - 200px); min-height: calc(100vh - 200px);
border: 1px solid #cacaca; /* border: 1px solid #cacaca; */
} }
/* /*

View File

@ -29,3 +29,6 @@ rect {
.graph-distribution-so { .graph-distribution-so {
margin-top: 55px; margin-top: 55px;
} }
#list_agents_tactical_wrapper .dataTables_length {
margin-bottom: 10px;
}

View File

@ -12,7 +12,7 @@
padding: 0px; padding: 0px;
} }
.window { .window {
background-image: linear-gradient(180deg, #fffce8 0%, #ffffff 100%); background-image: white;
width: 640px; width: 640px;
width: 100%; width: 100%;
border-radius: 5px; border-radius: 5px;
@ -145,9 +145,6 @@
color: #14524f; color: #14524f;
font-weight: 600; font-weight: 600;
} }
#url_tip .arrow_tips {
font-size: 20px;
}
span.count-round-tip { span.count-round-tip {
width: 6px !important; width: 6px !important;
height: 6px !important; height: 6px !important;
@ -211,3 +208,7 @@ span.disable {
.buttons_actions input { .buttons_actions input {
width: 32px; width: 32px;
} }
.hide-button {
opacity: 0;
pointer-events: none;
}

View File

@ -187,7 +187,7 @@ html_print_div(
'class' => 'agent_details_line', 'class' => 'agent_details_line',
'content' => ui_toggle( 'content' => ui_toggle(
$html_toggle, $html_toggle,
'<span class="subsection_header_title">'.__('List of modules').'</span>'.$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.'), __('To see the list of modules paginated, enable this option in the Styles Configuration.'),
true true
).reporting_tiny_stats( ).reporting_tiny_stats(
@ -201,9 +201,9 @@ html_print_div(
false, false,
false, false,
true, true,
'box-flat agent_details_col', '',
'white-box-content', 'white-box-content',
'width_available' 'box-flat white_table_graph w100p'
), ),
], ],
); );
@ -543,58 +543,83 @@ function print_form_filter_monitors(
$form_text = ''; $form_text = '';
$table = new stdClass(); $table = new stdClass();
$table->class = 'filter-table-adv'; $table->class = 'filter-table-adv';
$table->id = 'module_filter_agent_view'; // $table->id = 'module_filter_agent_view';
$table->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;'; // $table->styleTable = 'border-radius: 0;padding: 0;margin: 0 0 10px;';
$table->width = '100%'; $table->width = '100%';
$table->cellstyle[0][0] = 'width: 0'; $table->size[0] = '25%';
$table->cellstyle[0][1] = 'width: 0'; $table->size[1] = '25%';
$table->cellstyle[0][2] = 'width: 0'; $table->size[2] = '25%';
$table->size[3] = '25%';
// Captions. // Captions.
$table->data[0][0] = html_print_input_hidden('filter_monitors', 1, true); $table->data[0][0] = html_print_label_input_block(
$table->data[0][0] .= html_print_input_hidden('monitors_change_filter', 1, true); html_print_input_hidden('filter_monitors', 1, true).html_print_input_hidden(
$table->data[0][0] .= __('Status:'); 'monitors_change_filter',
$table->data[0][1] = __('Free text for search (*):').ui_print_help_tip( 1,
__('Search by module name, list matches.'), true
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'); $table->data[0][1] = html_print_label_input_block(
// Inputs. __('Free text for search (*):').ui_print_help_tip(
$table->data[1][0] = html_print_select( __('Search by module name, list matches.'),
$status_list, true
'status_filter_monitor', ),
$status_filter_monitor, html_print_input_text(
'', 'status_text_monitor',
'', $status_text_monitor,
0, '',
true '',
100,
true
)
); );
$table->data[1][1] = html_print_input_text(
'status_text_monitor', $table->data[0][2] = html_print_label_input_block(
$status_text_monitor, __('Module group'),
'', html_print_select(
'', $rows_select,
100, 'status_module_group',
true $status_module_group,
'',
'',
0,
true,
false,
true,
'w100p',
false,
'width:100%'
)
); );
$table->data[1][2] = html_print_select(
$rows_select, $table->data[0][3] = html_print_label_input_block(
'status_module_group', __('Show in hierachy mode'),
$status_module_group, html_print_switch(
'', [
'', 'name' => 'status_hierachy_mode',
0, 'value' => $all_events_24h,
true 'onchange' => 'change_module_filter()',
); 'id' => 'checkbox-status_hierachy_mode',
$table->data[1][3] = 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 = [];
$filtersButtons[] = html_print_button( $filtersButtons[] = html_print_button(
@ -603,8 +628,9 @@ function print_form_filter_monitors(
false, false,
'filter_modules();', 'filter_modules();',
[ [
'icon' => 'search', 'icon' => 'search',
'mode' => 'secondary mini', 'mode' => 'secondary mini',
'style' => 'margin-left: 15px',
], ],
true true
); );
@ -621,16 +647,6 @@ function print_form_filter_monitors(
true 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. // TODO. Unused code.
if ($status_filter_monitor === -1 && empty($status_text_monitor) === true && $status_module_group === -1) { if ($status_filter_monitor === -1 && empty($status_text_monitor) === true && $status_module_group === -1) {
$filter_hidden = true; $filter_hidden = true;
@ -639,4 +655,10 @@ function print_form_filter_monitors(
} }
echo $form_text; echo $form_text;
html_print_div(
[
'class' => 'action-buttons-right-forced',
'content' => implode('', $filtersButtons),
]
);
} }

View File

@ -321,7 +321,7 @@ if (empty($result_groups) === false) {
$link = "<a href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']."'>"; $link = "<a href='index.php?sec=monitoring&sec2=operation/tree&tag_id=".$data['_id_']."'>";
} else { } else {
$deep = groups_get_group_deep($data['_id_']); $deep = groups_get_group_deep($data['_id_']);
$link = "<a href='index.php?sec=view&sec2=operation/agentes/estado_agente&group_id=".$data['_id_']."'>"; $link = "<a href='index.php?sec=view&sec2=godmode/groups/tactical&id_group=".$data['_id_']."'>";
} }
$group_name = '<b><span>'.ui_print_truncate_text($data['_name_'], 50).'</span></b>'; $group_name = '<b><span>'.ui_print_truncate_text($data['_name_'], 50).'</span></b>';

View File

@ -94,6 +94,19 @@ if (!empty($table->data)) {
echo '<div id="log_sources_status" class="w100p">'; echo '<div id="log_sources_status" class="w100p">';
html_print_table($table); html_print_table($table);
echo '</div>'; echo '</div>';
$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 { } else {
ui_print_info_message(['no_close' => true, 'message' => __('No log sources found') ]); ui_print_info_message(['no_close' => true, 'message' => __('No log sources found') ]);
$log_sources_defined = false; $log_sources_defined = false;
@ -109,18 +122,6 @@ html_print_input_hidden('redirect_search', 1, false);
echo '</form>'; echo '</form>';
$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'
);
?> ?>

View File

@ -1940,6 +1940,12 @@ if ((bool) $config['pure'] === false) {
'link' => '', 'link' => '',
'label' => $tab_name, 'label' => $tab_name,
], ],
],
[
'id_element' => $id_agente,
'url' => 'operation/agentes/ver_agente&id_agente='.$id_agente,
'label' => agents_get_alias($id_agente),
'section' => 'Agents',
] ]
); );
} }

View File

@ -50,7 +50,7 @@ try {
'known_status', 'known_status',
[ [
'text' => 'options', '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) { } catch (Exception $e) {
@ -109,24 +110,20 @@ try {
} }
if (check_acl($config['id_user'], 0, 'AW')) { if (check_acl($config['id_user'], 0, 'AW')) {
HTML::printForm( $buttons[] = html_print_submit_button(
__('New cluster'),
'submit',
false,
[ [
'form' => [ 'class' => 'sub ok',
'method' => 'POST', 'icon' => 'next',
'action' => ui_get_full_url($model->url.'&op=new'), ],
], true
'inputs' => [
[
'class' => 'w100p',
'arguments' => [
'name' => 'submit',
'label' => __('New cluster'),
'type' => 'submit',
'attributes' => 'class="sub next"',
'return' => true,
],
],
],
]
); );
echo '<form action="'.ui_get_full_url($model->url.'&op=new').'" method="POST">';
html_print_action_buttons(
implode('', $buttons),
['type' => 'form_action']
);
echo '</form>';
} }

View File

@ -358,17 +358,13 @@ $map_manager = new NetworkMap(
* *
*/ */
$table_events = '<div class="white_table_graph" id="table_events">'; $table_events = '<div class="white_table_graph" id="table_events" style="width:100%">';
$table_events .= '<div class="white_table_graph_header">'; $table_events .= '<div class="agent_details_header">';
$table_events .= html_print_image( $table_events .= '<b><span style="font-size: medium;font-weight:bold">';
'images/arrow_down_green.png',
true
);
$table_events .= '<span>';
$table_events .= __('Events (Last 24h)'); $table_events .= __('Events (Last 24h)');
$table_events .= '</span>'; $table_events .= '</span></b>';
$table_events .= '</div>'; $table_events .= '</div>';
$table_events .= '<div class="white_table_graph_content white-table-graph-content">'; $table_events .= '<div class="white-table-graph-content">';
$table_events .= graph_graphic_agentevents( $table_events .= graph_graphic_agentevents(
$cluster->agent()->id_agente(), $cluster->agent()->id_agente(),
95, 95,
@ -384,29 +380,34 @@ $table_events .= '</div>';
?> ?>
<div id="agent_details_first_row" class="w100p cluster-agent-data"> <div id="agent_details_first_row" class="w100p cluster-agent-data">
<div class="box-flat agent_details_col agent_details_col_left"> <div class="flex">
<div class="agent_details_header"> <div class="box-flat agent_details_col agent_details_col_left" style="width:50%">
<?php echo $table_agent_header; ?> <div class="agent_details_header">
</div> <?php echo $table_agent_header; ?>
<div class="agent_details_content"> </div>
<div class="agent_details_graph"> <div class="agent_details_content">
<?php echo $table_agent_graph; ?> <div class="agent_details_graph">
<div class="agent_details_bullets"> <?php echo $table_agent_graph; ?>
<?php echo $table_agent_count_modules; ?> <div class="agent_details_bullets">
<?php echo $table_agent_count_modules; ?>
</div>
</div>
<div class="agent_details_info">
<?php
echo $alive_animation;
echo $table_agent_os;
echo $table_agent_ip;
echo $table_agent_version;
echo $table_agent_description;
?>
</div> </div>
</div> </div>
<div class="agent_details_info"> </div>
<?php
echo $alive_animation; <div class="box-flat agent_details_col" style="width:50%">
echo $table_agent_os; <?php echo $table_events; ?>
echo $table_agent_ip;
echo $table_agent_version;
echo $table_agent_description;
?>
</div>
</div> </div>
</div> </div>
<div class="box-flat agent_details_col agent_details_col_right"> <div class="box-flat agent_details_col agent_details_col_right">
<div class="cluster-map"> <div class="cluster-map">
<?php $map_manager->printMap(); ?> <?php $map_manager->printMap(); ?>
@ -414,10 +415,6 @@ $table_events .= '</div>';
</div> </div>
</div> </div>
<div class="w100p cluster-events-graph">
<?php echo $table_events; ?>
</div>
<div id='cluster-modules' class="w100p modules"> <div id='cluster-modules' class="w100p modules">
<?php <?php
$id_agente = $cluster->agent()->id_agente(); $id_agente = $cluster->agent()->id_agente();
@ -427,28 +424,22 @@ require_once $config['homedir'].'/operation/agentes/estado_monitores.php';
<?php <?php
HTML::printForm( $buttons[] = html_print_submit_button(
__('Reload'),
'submit',
false,
[ [
'form' => [ 'class' => 'sub ok',
'action' => $model->url.'&op=view&id='.$cluster->id(), 'icon' => 'next',
'method' => 'POST',
],
'inputs' => [
[
'arguments' => [
'name' => 'submit',
'label' => __('Reload'),
'type' => 'submit',
'attributes' => 'class="sub cancel"',
'return' => true,
],
],
],
], ],
false true
); );
echo '<form action="'.$model->url.'&op=view&id='.$cluster->id().'" method="POST">';
echo '<br/>'; html_print_action_buttons(
implode('', $buttons),
['type' => 'form_action']
);
echo '</form>';
// Print always go back button. // Print always go back button.
HTML::printForm($model->getGoBackForm(), false); HTML::printForm($model->getGoBackForm(), false);

View File

@ -73,10 +73,13 @@ $output .= '<p id="text_tip">';
$output .= $text; $output .= $text;
$output .= '</p>'; $output .= '</p>';
$link_class = 'invisible';
if (empty($url) === false && $url !== '') { if (empty($url) === false && $url !== '') {
$output .= '<a href="'.$url.'" target="_blank" id="url_tip">'.__('See more info').'<span class="arrow_tips">→</span></a>'; $link_class = '';
} }
$output .= '<a href="'.$url.'" class="'.$link_class.'" target="_blank" id="url_tip">'.__('See more info').'</a>';
$output .= '</div>'; $output .= '</div>';
$output .= '<div class="ui-dialog-buttonset">'; $output .= '<div class="ui-dialog-buttonset">';
@ -116,7 +119,7 @@ if ($preview === true) {
'', '',
[ [
'onclick' => 'next_tip()', 'onclick' => 'next_tip()',
'class' => 'mini', 'class' => ($totalTips === '1') ? 'mini hide-button' : 'mini',
], ],
true true
); );