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

This commit is contained in:
Jonathan 2023-03-30 13:56:58 +02:00
commit 1a456c0c63
11 changed files with 163 additions and 102 deletions

View File

@ -776,7 +776,7 @@ if ($agents !== false) {
} }
if ((bool) $agent['disabled'] === true) { if ((bool) $agent['disabled'] === true) {
$additionalDataAgentName[] = ui_print_help_tip(__('Disabled')); $additionalDataAgentName[] = ui_print_help_tip(__('Disabled'), true);
} }
if ((bool) $agent['quiet'] === true) { if ((bool) $agent['quiet'] === true) {
@ -903,12 +903,12 @@ if ($agents !== false) {
if ((bool) $agent['disabled'] === true) { if ((bool) $agent['disabled'] === true) {
$agentDisableEnableTitle = __('Enable agent'); $agentDisableEnableTitle = __('Enable agent');
$agentDisableEnableAction = 'enable_agent'; $agentDisableEnableAction = 'enable';
$agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?'); $agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-active.svg'; $agentDisableEnableIcon = 'change-active.svg';
} else { } else {
$agentDisableEnableTitle = __('Disable agent'); $agentDisableEnableTitle = __('Disable agent');
$agentDisableEnableAction = 'disable_agent'; $agentDisableEnableAction = 'disable';
$agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?'); $agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?');
$agentDisableEnableIcon = 'change-pause.svg'; $agentDisableEnableIcon = 'change-pause.svg';
} }
@ -1001,7 +1001,7 @@ if ($agents !== false) {
true, true,
'offset', 'offset',
false, false,
'dataTables_paginate paging_simple_numbers' 'paging_simple_numbers'
); );
/* /*

View File

@ -30,6 +30,26 @@ if (! check_acl($config['id_user'], 0, 'AR')
$update = get_parameter('upd_button', ''); $update = get_parameter('upd_button', '');
$default = (int) get_parameter('default', 0); $default = (int) get_parameter('default', 0);
// Header.
ui_print_standard_header(
__('Monitor detail').$subpage,
'images/agent.png',
false,
'',
true,
$buttons,
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
],
(empty($fav_menu) === true) ? [] : $fav_menu
);
if ($default != 0) { if ($default != 0) {
$fields_selected = explode(',', $config['status_monitor_fields']); $fields_selected = explode(',', $config['status_monitor_fields']);
@ -161,11 +181,11 @@ foreach ($fields_available as $key => $available) {
// General title. // General title.
$generalTitleContent = []; $generalTitleContent = [];
$generalTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true); // $generalTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
$generalTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Show monitor detail fields')], true); $generalTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Show monitor detail fields')], true);
$titledata[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $generalTitleContent) ], true); $titledata[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $generalTitleContent) ], true);
$table->data['general_title'] = $titledata; $table->data['general_title'] = $titledata;
$table->data[0][0] = '<b>'.__('Fields available').'</b>'; $table->data[0][0] = '<span class="font-title-font">'.__('Fields available').'</span>';
$table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px'); $table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px');
$table->data[1][1] = '<a href="javascript:">'.html_print_image( $table->data[1][1] = '<a href="javascript:">'.html_print_image(
'images/darrowright.png', 'images/darrowright.png',
@ -187,7 +207,7 @@ $table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
).'</a>'; ).'</a>';
$table->data[0][1] = ''; $table->data[0][1] = '';
$table->data[0][2] = '<b>'.__('Fields selected').'</b>'; $table->data[0][2] = '<span class="font-title-font">'.__('Fields selected').'</span>';
$table->data[1][2] = html_print_select( $table->data[1][2] = html_print_select(
$result_selected, $result_selected,
'fields_selected[]', 'fields_selected[]',
@ -203,7 +223,7 @@ $table->data[1][2] = html_print_select(
'width: 300px' 'width: 300px'
); );
echo '<form id="custom_status_monitor" method="post" action="index.php?sec=view&sec2=operation/agentes/status_monitor&section=fields&amp;pure='.$config['pure'].'">'; echo '<form id="custom_status_monitor" method="post" action="index.php?sec=view&sec2=operation/agentes/status_monitor&section=fields&amp;pure='.$config['pure'].'" class="max_floating_element_size">';
html_print_table($table); html_print_table($table);
html_print_action_buttons( html_print_action_buttons(

View File

@ -54,12 +54,6 @@ $results = db_get_all_rows_in_table('tconsole');
$message = ''; $message = '';
if ($results === false) {
$message = ui_print_info_message(
__('If you want to have your consoles registered, you must define them by editing config.php in each individual console and wait for cron to run in order to be registered.')
);
}
View::render( View::render(
'consoles/list', 'consoles/list',
[ [
@ -67,3 +61,9 @@ View::render(
'message' => $message, 'message' => $message,
] ]
); );
if ($results === false) {
$message = ui_print_info_message(
__('If you want to have your consoles registered, you must define them by editing config.php in each individual console and wait for cron to run in order to be registered.')
);
}

View File

@ -45,73 +45,101 @@ if (is_ajax() === true) {
$group = get_parameter('group', true); $group = get_parameter('group', true);
echo '<form id="form_dialog" method="post">'; echo '<form id="form_dialog" method="post">';
echo '<div class="div-dialog">'; echo html_print_label_input_block(
echo '<p class="label-dialog">'.__('Refresh').'</p>'; __('Refresh'),
echo html_print_select( html_print_select(
[
'30' => __('30 seconds'),
(string) SECONDS_1MINUTE => __('1 minute'),
'180' => __('3 minutes'),
(string) SECONDS_5MINUTES => __('5 minutes'),
],
'refresh',
$refresh,
'',
'',
0,
true,
false,
false,
'',
false,
'width: 100%; margin-top: 10px;'
),
[ [
'30' => __('30 seconds'), 'label_class' => 'font-title-font',
(string) SECONDS_1MINUTE => __('1 minute'), 'div_class' => 'mrgn_top_10px',
'180' => __('3 minutes'), ]
(string) SECONDS_5MINUTES => __('5 minutes'),
],
'refresh',
$refresh,
'',
'',
0,
true,
false,
false,
'',
false,
'margin-top: 3px;'
); );
echo '</div>';
echo '<div class="div-dialog">'; echo html_print_label_input_block(
echo '<p class="label-dialog">'.__('Search').'</p>'; __('Search'),
echo html_print_input_text('search', $search, '', 30, 255, true); html_print_input_text(
echo '</div>'; 'search',
$search,
echo '<div class="div-dialog">'; '',
echo '<p class="label-dialog">'.__('Type').'</p>'; 30,
echo html_print_select( 255,
true,
false,
false,
'',
'w100p'
),
[ [
0 => __('Group agents'), 'label_class' => 'font-title-font',
1 => __('Group modules by tag'), 'div_class' => 'mrgn_top_10px',
2 => __('Group modules by module group'), ]
3 => __('Group modules by agents'),
],
'type',
$type,
'',
'',
0,
true,
false,
false,
'',
false,
'margin-top: 3px;width:70%'
); );
echo '</div>';
echo '<div class="div-dialog">'; echo html_print_label_input_block(
echo '<p class="label-dialog">'.__('Show groups').'</p>'; __('Type'),
echo html_print_checkbox('group', 1, $group, true); html_print_select(
echo '</div>'; [
0 => __('Group agents'),
1 => __('Group modules by tag'),
2 => __('Group modules by module group'),
3 => __('Group modules by agents'),
],
'type',
$type,
'',
'',
0,
true,
false,
false,
'',
false,
'width: 100%; margin-top: 10px;'
),
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_top_10px',
]
);
echo html_print_label_input_block(
__('Show groups'),
'<div class="w100p">'.html_print_checkbox('group', 1, $group, true).'</div>',
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_top_10px',
]
);
echo '</form>'; echo '</form>';
} }
if ($getFilterType === true) { if ($getFilterType === true) {
$filter = get_parameter('filter', 0); $filter = get_parameter('filter', 0);
echo '<div id="filter_type" class="div-dialog">'; $label = ' ';
switch ($type) { switch ($type) {
case 0: case 0:
default: default:
echo '<p style="width:42%;font-weight: bold;">'.__('Group').'</p>'; $label = __('Group');
echo html_print_input( $input = html_print_input(
[ [
'type' => 'select_groups', 'type' => 'select_groups',
'returnAllGroup' => true, 'returnAllGroup' => true,
@ -126,9 +154,9 @@ if (is_ajax() === true) {
break; break;
case 1: case 1:
echo '<p class="label-dialog">'.__('Tag').'</p>'; $label = __('Tag');
if (tags_has_user_acl_tags($config['id_user']) === false) { if (tags_has_user_acl_tags($config['id_user']) === false) {
echo html_print_select_from_sql( $input = html_print_select_from_sql(
'SELECT id_tag, name 'SELECT id_tag, name
FROM ttag FROM ttag
WHERE id_tag WHERE id_tag
@ -142,7 +170,7 @@ if (is_ajax() === true) {
true, true,
false, false,
false, false,
'width: 200px', 'width: 100%',
'5' '5'
); );
} else { } else {
@ -150,7 +178,7 @@ if (is_ajax() === true) {
if (!empty($user_tags)) { if (!empty($user_tags)) {
$id_user_tags = array_keys($user_tags); $id_user_tags = array_keys($user_tags);
echo html_print_select_from_sql( $input = html_print_select_from_sql(
'SELECT id_tag, name 'SELECT id_tag, name
FROM ttag FROM ttag
WHERE id_tag IN ('.implode(',', $id_user_tags).') WHERE id_tag IN ('.implode(',', $id_user_tags).')
@ -164,11 +192,11 @@ if (is_ajax() === true) {
true, true,
false, false,
false, false,
'width: 200px', 'width: 100%',
'5' '5'
); );
} else { } else {
echo html_print_select_from_sql( $input = html_print_select_from_sql(
'SELECT id_tag, name 'SELECT id_tag, name
FROM ttag FROM ttag
WHERE id_tag WHERE id_tag
@ -182,7 +210,7 @@ if (is_ajax() === true) {
true, true,
false, false,
false, false,
'width: 200px', 'width: 100%',
'5' '5'
); );
} }
@ -190,8 +218,8 @@ if (is_ajax() === true) {
break; break;
case 2: case 2:
echo '<p class="label-dialog">'.__('Module group').'</p>'; $label = __('Module group');
echo html_print_select_from_sql( $input = html_print_select_from_sql(
'SELECT id_mg, name FROM tmodule_group ORDER BY name', 'SELECT id_mg, name FROM tmodule_group ORDER BY name',
'filter[]', 'filter[]',
$filter, $filter,
@ -202,7 +230,7 @@ if (is_ajax() === true) {
true, true,
true, true,
false, false,
'width: 200px', 'width: 100%',
'5' '5'
); );
break; break;
@ -212,7 +240,14 @@ if (is_ajax() === true) {
break; break;
} }
echo '</div>'; echo html_print_label_input_block(
$label,
$input,
[
'label_class' => 'font-title-font',
'div_class' => 'mrgn_top_10px',
]
);
} }
if ($getInfo === true) { if ($getInfo === true) {

View File

@ -771,7 +771,7 @@ class AgentsAlerts extends HTML
$headerInputs = []; $headerInputs = [];
$headerInputs[] = [ $headerInputs[] = [
'label' => __('Group'), 'label' => '<span class="font-title-font">'.__('Group').'</span>',
'id' => 'select-group-id', 'id' => 'select-group-id',
'arguments' => [ 'arguments' => [
'name' => 'group-id', 'name' => 'group-id',
@ -788,8 +788,9 @@ class AgentsAlerts extends HTML
]; ];
$headerInputs[] = [ $headerInputs[] = [
'label' => __('Show modules without alerts'), 'label' => '<span class="font-title-font label-alert-agent">'.__('Show modules without alerts').'</span>',
'id' => 'txt-use-agent-ip', 'id' => 'txt-use-agent-ip',
'class' => 'display-grid mrgn_lft_15px mrgn_btn_5px',
'arguments' => [ 'arguments' => [
'name' => 'show-modules-without-alerts', 'name' => 'show-modules-without-alerts',
'checked' => $this->showWithoutAlertModules, 'checked' => $this->showWithoutAlertModules,

View File

@ -805,6 +805,11 @@ select:-internal-list-box {
max-height: 400px; max-height: 400px;
} }
.mx_height85 {
height: 85px !important;
max-height: 85px !important;
}
.no-text-imp { .no-text-imp {
font-size: 0 !important; font-size: 0 !important;
} }
@ -10124,10 +10129,6 @@ select:focus {
border-color: #8a96a6; border-color: #8a96a6;
} }
.dataTables_length > label > select {
min-height: 42px;
}
.dataTables_length > label { .dataTables_length > label {
font-size: 0px; font-size: 0px;
} }
@ -11857,3 +11858,7 @@ li.input-interval .extra-container-input .select2 {
.scale-0-8 { .scale-0-8 {
transform: scale(0.8); transform: scale(0.8);
} }
label:has(span.label-alert-agent) {
margin-bottom: 10px;
}

View File

@ -313,7 +313,7 @@ table.dataTable.info_table.no-footer {
a.pandora_pagination { a.pandora_pagination {
background-color: #f6f7fb; background-color: #f6f7fb;
padding: 11px; padding: 9px;
color: #000; color: #000;
border: 1px solid #cacaca; border: 1px solid #cacaca;
border-left: none; border-left: none;
@ -362,7 +362,7 @@ a.pandora_pagination.current:hover {
background-color: transparent; background-color: transparent;
color: var(--primary-color); color: var(--primary-color);
font-size: 20px; font-size: 20px;
height: 42px; height: 38px;
/* height: 32px; */ /* height: 32px; */
width: 80px; width: 80px;
margin-left: 10px; margin-left: 10px;
@ -820,10 +820,6 @@ div[id^="auto-os-"] > img {
margin-right: 10px; margin-right: 10px;
} }
.dataTables_paginate.paging_simple_numbers {
margin-right: 0;
}
.w22px { .w22px {
width: 22px; width: 22px;
} }

View File

@ -1301,7 +1301,7 @@ if (empty($tableAgents->data) === false) {
true, true,
'offset', 'offset',
false, false,
'dataTables_paginate paging_simple_numbers' 'paging_simple_numbers'
); );
unset($table); unset($table);

View File

@ -907,6 +907,9 @@ $tableFilter->data['second_line'][1] = html_print_label_input_block(
true, true,
'', '',
[], [],
true,
0,
'30',
true true
) )
); );

View File

@ -149,13 +149,13 @@ if ($is_ajax === false && $pure === false) {
if ($is_ajax === false && $pure === true) { if ($is_ajax === false && $pure === true) {
// Floating menu - Start. // Floating menu - Start.
echo '<div id="heatmap-controls" class="zindex999">'; echo '<div id="heatmap-controls" class="zindex999" style="max-height: 85px">';
echo '<div id="menu_tab" method="post">'; echo '<div id="menu_tab" method="post">';
echo '<ul class="mn white-box-content box-shadow flex-row">'; echo '<ul class="mn white-box-content box-shadow flex-row">';
// Name. // Name.
echo '<li class="nomn">'; echo '<li class="nomn mx_height85">';
html_print_div( html_print_div(
[ [
@ -167,7 +167,7 @@ if ($is_ajax === false && $pure === true) {
echo '</li>'; echo '</li>';
// Countdown. // Countdown.
echo '<li class="nomn">'; echo '<li class="nomn mx_height85">';
echo '<div class="heatmap-refr">'; echo '<div class="heatmap-refr">';
echo '<div id="heatmap-refr-form">'; echo '<div id="heatmap-refr-form">';
@ -282,7 +282,7 @@ if ($is_ajax === true) {
draggable: false, draggable: false,
modal: true, modal: true,
closeOnEscape: true, closeOnEscape: true,
height: 410, height: 500,
width: 330, width: 330,
title: '<?php echo __('Config'); ?>', title: '<?php echo __('Config'); ?>',
position: { position: {

View File

@ -27,21 +27,22 @@
*/ */
// Header. // Header.
\ui_print_page_header( ui_print_standard_header(
// Title.
__('%s registered consoles', $config['rb_product_name']), __('%s registered consoles', $config['rb_product_name']),
// Icon.
'', '',
// Return.
false, false,
// Help.
'', '',
// Godmode.
true, true,
// Options. [],
'' [
[
'link' => '',
'label' => __('Servers'),
],
]
); );
if (empty($message) === false) { if (empty($message) === false) {
echo $message; echo $message;
} }