10454-Events

This commit is contained in:
Pablo Aragon 2023-02-27 09:57:17 +01:00
parent 6f16c45285
commit e024658520
8 changed files with 708 additions and 359 deletions

View File

@ -127,19 +127,21 @@ foreach ($fields_available as $key => $available) {
$table->data[0][0] = '<b>'.__('Fields available').'</b>'; $table->data[0][0] = '<b>'.__('Fields available').'</b>';
$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_green.png', 'images/arrow@svg.svg',
true, true,
[ [
'id' => 'right', 'id' => 'right',
'title' => __('Add fields to select'), 'title' => __('Add fields to select'),
'style' => 'rotate: 180deg; width: 40px',
] ]
).'</a>'; ).'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image( $table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
'images/darrowleft_green.png', 'images/arrow@svg.svg',
true, true,
[ [
'id' => 'left', 'id' => 'left',
'title' => __('Delete fields to select'), 'title' => __('Delete fields to select'),
'style' => 'width: 40px',
] ]
).'</a>'; ).'</a>';

View File

@ -262,12 +262,17 @@ if ($create) {
$own_info = get_user_info($config['id_user']); $own_info = get_user_info($config['id_user']);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '1366px';
// $table->width = '100%';
$table->border = 0; $table->border = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->cellpadding = 0; $table->cellpadding = 0;
$table->class = 'databox filters'; $table->size[0] = '50%';
$table->size[1] = '50%';
$table->class = 'databox filters events-filters-create';
$table->style[0] = 'vertical-align: top;'; $table->style[0] = 'vertical-align: top;';
$table->rowspan = [];
$table->rowspan[3][0] = 2;
$table->valign[1] = 'top'; $table->valign[1] = 'top';
@ -285,10 +290,22 @@ if (is_metaconsole()) {
} }
$table->data = []; $table->data = [];
$table->data[0][0] = '<b>'.__('Filter name').'</b>';
$table->data[0][1] = html_print_input_text('id_name', $id_name, false, 20, 80, true);
$table->data[1][0] = '<b>'.__('Save in group').'</b>'.ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true); $table->data[0][0] = html_print_label_input_block(
__('Filter name'),
html_print_input_text(
'id_name',
$id_name,
false,
20,
80,
true,
false,
false,
'',
'w100p'
)
);
$returnAllGroup = users_can_manage_group_all(); $returnAllGroup = users_can_manage_group_all();
// If the user can't manage All group but the filter is for All group, the user should see All group in the select. // If the user can't manage All group but the filter is for All group, the user should see All group in the select.
@ -296,115 +313,135 @@ if ($returnAllGroup === false && $id_group_filter == 0) {
$returnAllGroup = true; $returnAllGroup = true;
} }
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups( $table->data[0][1] = html_print_label_input_block(
$config['id_user'], __('Save in group').ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true),
$access, '<div class="w100p">'.html_print_select_groups(
$returnAllGroup, $config['id_user'],
'id_group_filter', $access,
$id_group_filter, $returnAllGroup,
'', 'id_group_filter',
'', $id_group_filter,
-1, '',
true, '',
false, -1,
false, true,
'', false,
false, false,
'', '',
false, false,
false, '',
'id_grupo', false,
$strict_user false,
).'</div>'; 'id_grupo',
$strict_user
).'</div>'
);
$return_all_group = false; $return_all_group = false;
if (users_can_manage_group_all('AR') === true) { if (users_can_manage_group_all('AR') === true) {
$return_all_group = true; $return_all_group = true;
} }
$table->data[2][0] = '<b>'.__('Group').'</b>';
$display_all_group = (users_is_admin() || users_can_manage_group_all('AR')); $display_all_group = (users_is_admin() || users_can_manage_group_all('AR'));
$table->data[2][1] = '<div class="w250px">'.html_print_select_groups( $table->data[2][0] = html_print_label_input_block(
$config['id_user'], __('Group'),
'AR', '<div class="w100p">'.html_print_select_groups(
$return_all_group, $config['id_user'],
'id_group', 'AR',
$id_group, $return_all_group,
'', 'id_group',
'', $id_group,
'', '',
true '',
).'</div>'; '',
true
).'</div>'
);
$types = get_event_types(); $types = get_event_types();
// Expand standard array to add not_normal (not exist in the array, used only for searches) // Expand standard array to add not_normal (not exist in the array, used only for searches)
$types['not_normal'] = __('Not normal'); $types['not_normal'] = __('Not normal');
$table->data[2][1] = html_print_label_input_block(
$table->data[3][0] = '<b>'.__('Event type').'</b>'; __('Event type'),
$table->data[3][1] = html_print_select( '<div class="w100p">'.html_print_select(
$types, $types,
'event_type', 'event_type',
$event_type, $event_type,
'', '',
__('All'), __('All'),
'', '',
true true,
false,
false,
'w100p'
).'</div>'
); );
if (empty($severity) && $severity !== '0') { if (empty($severity) && $severity !== '0') {
$severity = -1; $severity = -1;
} }
$table->data[4][0] = '<b>'.__('Severity').'</b>'; $table->data[3][0] = html_print_label_input_block(
$table->data[4][1] = html_print_select( __('Severity'),
get_priorities(), html_print_select(
'severity[]', get_priorities(),
$severity, 'severity[]',
'', $severity,
__('All'), '',
-1, __('All'),
true, -1,
true, true,
true, true,
'', true,
false, '',
'width: 175px' false,
'width: 100%'
)
); );
$fields = events_get_all_status(); $fields = events_get_all_status();
$table->data[3][1] = html_print_label_input_block(
$table->data[5][0] = '<b>'.__('Event status').'</b>'; __('Event status'),
$table->data[5][1] = html_print_select( html_print_select(
$fields, $fields,
'status', 'status',
$status, $status,
'', '',
'', '',
'', '',
true true,
false,
true,
'',
false,
'width: 100%'
)
); );
$table->data[6][0] = '<b>'.__('Free search').'</b>'; $table->data[4][1] = html_print_label_input_block(
$table->data[6][1] = html_print_input_text( __('Free search'),
'search', '<div class="flex_center">'.html_print_input_text(
$search, 'search',
'', $search,
15, '',
255, 15,
true 255,
); true,
$table->data[6][1] .= ' '.html_print_checkbox_switch( false,
'not_search', false,
$not_search, '',
$not_search, 'w96p mrgn_right_15px'
true, ).' '.html_print_checkbox_switch(
false, 'not_search',
'checked_slide_events(this);', $not_search,
true $not_search,
true,
false,
'checked_slide_events(this);',
true
).'</div>'
); );
$table->data[7][0] = '<b>'.__('Agent search').'</b>';
$params = []; $params = [];
$params['show_helptip'] = true; $params['show_helptip'] = true;
$params['input_name'] = 'text_agent'; $params['input_name'] = 'text_agent';
@ -419,39 +456,48 @@ if (is_metaconsole()) {
$params['hidden_input_idagent_value'] = $id_agent; $params['hidden_input_idagent_value'] = $id_agent;
} }
$table->data[7][1] = ui_print_agent_autocomplete_input($params); $table->data[5][0] = html_print_label_input_block(
__('Agent search'),
'<div class="w100p">'.ui_print_agent_autocomplete_input($params).'</div>'
);
$lpagination[25] = 25; $lpagination[25] = 25;
$lpagination[50] = 50; $lpagination[50] = 50;
$lpagination[100] = 100; $lpagination[100] = 100;
$lpagination[200] = 200; $lpagination[200] = 200;
$lpagination[500] = 500; $lpagination[500] = 500;
$table->data[8][0] = '<b>'.__('Block size for pagination').'</b>'; $table->data[5][1] = html_print_label_input_block(
$table->data[8][1] = html_print_select( __('Block size for pagination'),
$lpagination, '<div class="w100p">'.html_print_select(
'pagination', $lpagination,
$pagination, 'pagination',
'', $pagination,
__('Default'), '',
$config['block_size'], __('Default'),
true $config['block_size'],
true,
false,
true,
'',
false,
'width: 100%'
).'</div>'
); );
$table->data[9][0] = '<b>'.__('Max. hours old').'</b>'; $table->data[6][0] = html_print_label_input_block(
$table->data[9][1] = html_print_input_text( __('Max. hours old'),
'event_view_hr', '<div class="w100p">'.html_print_input_text(
$event_view_hr, 'event_view_hr',
'', $event_view_hr,
5, '',
255, 5,
true 255,
); true,
false,
$table->data[10][0] = '<b>'.__('User ack.').'</b>'; false,
$table->data[10][0] .= ' '; '',
$table->data[10][0] .= ui_print_help_tip( 'w100p'
__('Choose between the users who have validated an event. '), ).'</div>'
true
); );
if ($strict_user) { if ($strict_user) {
@ -464,49 +510,96 @@ if ($strict_user) {
); );
} }
$table->data[10][1] = html_print_select( $table->data[6][1] = html_print_label_input_block(
$users, __('User ack.').' '.ui_print_help_tip(
'id_user_ack', __('Choose between the users who have validated an event. '),
$id_user_ack, true
'', ),
__('Any'), '<div class="w100p">'.html_print_select(
0, $users,
true 'id_user_ack',
$id_user_ack,
'',
__('Any'),
0,
true,
false,
true,
'w100p'
).'</div>'
); );
$table->data[11][0] = '<b>'.__('Owner.').'</b>'; $table->data[7][0] = html_print_label_input_block(
$table->data[11][1] = html_print_select( __('Owner.'),
$users, '<div class="w100p">'.html_print_select(
'owner_user', $users,
$owner_user, 'owner_user',
'', $owner_user,
__('Any'), '',
0, __('Any'),
true 0,
true,
false,
true,
'w100p'
).'</div>'
); );
$repeated_sel = [ $repeated_sel = [
EVENT_GROUP_REP_ALL => __('All events'), EVENT_GROUP_REP_ALL => __('All events'),
EVENT_GROUP_REP_EVENTS => __('Group events'), EVENT_GROUP_REP_EVENTS => __('Group events'),
EVENT_GROUP_REP_AGENTS => __('Group agents'), EVENT_GROUP_REP_AGENTS => __('Group agents'),
EVENT_GROUP_REP_EXTRAIDS => __('Group extra id'), EVENT_GROUP_REP_EXTRAIDS => __('Group extra id'),
]; ];
$table->data[12][0] = '<b>'.__('Repeated').'</b>';
$table->data[12][1] = html_print_select( $table->data[7][1] = html_print_label_input_block(
$repeated_sel, __('Repeated'),
'group_rep', '<div class="w100p">'.html_print_select(
$group_rep, $repeated_sel,
'', 'group_rep',
'', $group_rep,
'', '',
true '',
'',
true,
false,
true,
'w100p'
).'</div>'
); );
$table->data[13][0] = '<b>'.__('Date from').'</b>'; $date_from = html_print_label_input_block(
$table->data[13][1] = html_print_input_text('date_from', $date_from, '', 15, 10, true); __('Date from'),
'<div class="w100p">'.html_print_input_text(
'date_to',
$date_to,
'',
15,
10,
true,
false,
false,
'',
'w100p'
).'</div>'
);
$table->data[14][0] = '<b>'.__('Date to').'</b>'; $date_to = html_print_label_input_block(
$table->data[14][1] = html_print_input_text('date_to', $date_to, '', 15, 10, true); __('Date from'),
'<div class="w100p">'.html_print_input_text(
'date_to',
$date_to,
'',
15,
10,
true,
false,
false,
'',
'w100p'
).'</div>'
);
$table->data[8][0] = '<div class="flex-row">'.$date_from.$date_to.'</div>';
$tag_with = json_decode($tag_with_json_clean, true); $tag_with = json_decode($tag_with_json_clean, true);
if (empty($tag_with)) { if (empty($tag_with)) {
@ -545,176 +638,272 @@ $remove_with_tag_disabled = empty($tag_with_temp);
$add_without_tag_disabled = empty($tags_select_without); $add_without_tag_disabled = empty($tags_select_without);
$remove_without_tag_disabled = empty($tag_without_temp); $remove_without_tag_disabled = empty($tag_without_temp);
$table->colspan[15][0] = '2'; $table->data[8][0] = html_print_label_input_block(
$table->data[15][0] = '<b>'.__('Events with following tags').'</b>'; __('Events with following tags'),
$table->data[16][0] = html_print_select( '<div class="w100p">'.html_print_select(
$tags_select_with, $tags_select_with,
'select_with', 'select_with',
'', '',
'', '',
'', '',
0, 0,
true, true,
false, false,
true, true,
'', 'w100p'
false, ).'</div>'
'width: 220px;'
);
$table->data[16][1] = html_print_button(
__('Add'),
'add_whith',
$add_with_tag_disabled,
'',
'class="add sub"',
true
); );
$table->data[17][0] = html_print_select( $table->data[8][1] = html_print_label_input_block(
$tag_with_temp, '&nbsp;',
'tag_with_temp', '<div class="w100p">'.html_print_button(
[], __('Add'),
'', 'add_whith',
'', $add_with_tag_disabled,
0, '',
true, ['class' => 'submitButton mini'],
true, true
true, ).'</div>'
'',
false,
'width: 220px; height: 50px;'
); );
$table->data[17][0] .= html_print_input_hidden(
$table->data[9][0] = html_print_label_input_block(
'',
'<div class="w100p no-margin-top">'.html_print_select(
$tag_with_temp,
'tag_with_temp',
[],
'',
'',
0,
true,
true,
true,
'',
false,
'width: 100%; height: 50px;'
).'</div>'
).html_print_input_hidden(
'tag_with', 'tag_with',
$tag_with_base64, $tag_with_base64,
true true
); );
$table->data[17][1] = html_print_button(
__('Remove'), $table->data[9][1] = html_print_label_input_block(
'remove_whith', '&nbsp;',
$remove_with_tag_disabled, '<div class="w100p">'.html_print_button(
'', __('Remove'),
'class="delete sub"', 'remove_whith',
true false,
'',
[
'mode' => 'link',
'class' => 'submitButton',
],
true
).'</div>'
); );
$table->colspan[18][0] = '2'; $table->data[10][0] = html_print_label_input_block(
$table->data[18][0] = '<b>'.__('Events without following tags').'</b>'; __('Events without following tags'),
$table->data[19][0] = html_print_select( '<div class="w100p">'.html_print_select(
$tags_select_without, $tags_select_without,
'select_without', 'select_without',
'', '',
'', '',
'', '',
0, 0,
true, true,
false, false,
true, true,
'', 'w100p'
false, ).'</div>'
'width: 220px;'
);
$table->data[19][1] = html_print_button(
__('Add'),
'add_whithout',
$add_without_tag_disabled,
'',
'class="add sub"',
true
); );
$table->data[20][0] = html_print_select( $table->data[10][1] = html_print_label_input_block(
$tag_without_temp, '&nbsp;',
'tag_without_temp', '<div class="w100p">'.html_print_button(
[], __('Add'),
'', 'add_whithout',
'', $add_without_tag_disabled,
0, '',
true, ['class' => 'submitButton mini'],
true, true
true, ).'</div>'
'',
false,
'width: 220px; height: 50px;'
); );
$table->data[20][0] .= html_print_input_hidden(
$table->data[11][0] = html_print_label_input_block(
'',
'<div class="w100p no-margin-top">'.html_print_select(
$tag_without_temp,
'tag_without_temp',
[],
'',
'',
0,
true,
true,
true,
'',
false,
'width: 100%; height: 50px;'
).'</div>'
).html_print_input_hidden(
'tag_without', 'tag_without',
$tag_without_base64, $tag_without_base64,
true true
); );
$table->data[20][1] = html_print_button(
__('Remove'), $table->data[11][1] = html_print_label_input_block(
'remove_whithout', '&nbsp;',
$remove_without_tag_disabled, '<div class="w100p">'.html_print_button(
'', __('Remove'),
'class="delete sub"', 'remove_whithout',
true false,
'',
[
'mode' => 'link',
'class' => 'submitButton',
],
true
).'</div>'
); );
$table->data[21][0] = '<b>'.__('Alert events').'</b>'; $table->data[12][0] = html_print_label_input_block(
$table->data[21][1] = html_print_select( __('Alert events'),
[ '<div class="w100p">'.html_print_select(
'-1' => __('All'), [
'0' => __('Filter alert events'), '-1' => __('All'),
'1' => __('Only alert events'), '0' => __('Filter alert events'),
], '1' => __('Only alert events'),
'filter_only_alert', ],
$filter_only_alert, 'filter_only_alert',
'', $filter_only_alert,
'', '',
'', '',
true '',
true,
false,
true,
'w100p'
).'</div>'
); );
if (!is_metaconsole()) { if (!is_metaconsole()) {
$table->data[22][0] = '<b>'.__('Module search').'</b>'; $table->data[12][1] = html_print_label_input_block(
$table->data[22][1] .= html_print_autocomplete_modules( __('Module search'),
'module_search', '<div class="w100p">'.html_print_autocomplete_modules(
$text_module, 'module_search',
false, $text_module,
true, false,
'', true,
[], '',
true, [],
$id_agent_module true,
$id_agent_module
).'</div>'
); );
} else {
$table->data[12][1] = '';
} }
$table->data[23][0] = '<b>'.__('Source').'</b>'; $table->data[13][0] = html_print_label_input_block(
$table->data[23][1] = html_print_input_text('source', $source, '', 35, 255, true); __('Source'),
'<div class="w100p">'.html_print_input_text(
$table->data[24][0] = '<b>'.__('Extra ID').'</b>'; 'source',
$table->data[24][1] = html_print_input_text('id_extra', $id_extra, '', 11, 255, true); $source,
$table->data[25][0] = '<b>'.__('Comment').'</b>';
$table->data[25][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true);
$table->data[26][0] = '<b>'.__('Custom data filter type').'</b>';
$table->data[26][1] = html_print_select(
[
'0' => __('Filter custom data by name field'),
'1' => __('Filter custom data by value field'),
],
'custom_data_filter_type',
$custom_data_filter_type,
'',
false,
'',
true
);
$table->data[27][0] = '<b>'.__('Custom data').'</b>';
$table->data[27][1] = html_print_input_text('custom_data', $custom_data, '', 35, 255, true);
if (is_metaconsole()) {
$table->data[28][0] = '<b>'.__('Id souce event').'</b>';
$table->data[28][1] = html_print_input_text(
'id_source_event',
$id_source_event,
'', '',
35, 35,
255, 255,
true true,
false,
false,
'',
'w100p'
).'</div>'
);
$table->data[13][1] = html_print_label_input_block(
__('Extra ID'),
'<div class="w100p">'.html_print_input_text(
'id_extra',
$id_extra,
'',
11,
255,
true,
false,
false,
'',
'w100p'
).'</div>'
);
$table->data[14][0] = html_print_label_input_block(
__('Comment'),
'<div class="w100p">'.html_print_input_text(
'user_comment',
$user_comment,
'',
35,
255,
true,
false,
false,
'',
'w100p'
).'</div>'
);
$table->data[14][1] = html_print_label_input_block(
__('Custom data filter type'),
'<div class="w100p">'.html_print_select(
[
'0' => __('Filter custom data by name field'),
'1' => __('Filter custom data by value field'),
],
'custom_data_filter_type',
$custom_data_filter_type,
'',
false,
'',
true,
false,
true,
'w100p'
).'</div>'
);
$table->data[15][0] = html_print_label_input_block(
__('Custom data'),
'<div class="w100p">'.html_print_input_text(
'custom_data',
$custom_data,
'',
35,
255,
true,
false,
false,
'',
'w100p'
).'</div>'
);
if (is_metaconsole()) {
$table->data[15][1] = html_print_label_input_block(
__('Id souce event'),
'<div class="w100p">'.html_print_input_text(
'id_source_event',
$id_source_event,
'',
35,
255,
true,
false,
false,
'',
'w100p'
).'</div>'
); );
} }
@ -750,20 +939,20 @@ if (is_metaconsole() === true) {
} }
} }
$table->data[29][0] = '<b>'.__('Server').'</b>'; $table->data[16][0] = html_print_label_input_block(
$table->data[29][1] = html_print_select( __('Server'),
$servers, '<div class="w100p">'.html_print_select(
'server_id[]', $servers,
$server_id, 'server_id[]',
'', $server_id,
'', '',
0, '',
true, 0,
true, true,
true, true,
'', true,
false, 'w100p'
'height: 60px;' ).'</div>'
); );
} }
@ -775,12 +964,14 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
if ($id) { if ($id) {
html_print_input_hidden('update', 1); html_print_input_hidden('update', 1);
html_print_input_hidden('id', $id); html_print_input_hidden('id', $id);
html_print_submit_button(__('Update'), 'crt', false, ['icon' => 'update']); $actionButtons = html_print_submit_button(__('Update'), 'crt', false, ['icon' => 'update'], true);
} else { } else {
html_print_input_hidden('create', 1); html_print_input_hidden('create', 1);
html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand']); $actionButtons = html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand'], true);
} }
html_print_action_buttons($actionButtons, ['type' => 'form_action']);
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';

View File

@ -198,37 +198,57 @@ foreach ($filters as $filter) {
array_push($table->data, $data); array_push($table->data, $data);
} }
if (isset($data)) { if (isset($data)) {
echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/events&amp;pure=".$config['pure']."'>"; echo "<form id='form-delete-filters' method='post' action='index.php?sec=geventos&sec2=godmode/events/events&amp;pure=".$config['pure']."'>";
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table($table); html_print_table($table);
if (!is_metaconsole()) { if (is_metaconsole() === true) {
echo "<div class='pdd_b_20px right'>";
} else {
echo "<div class='right'>"; echo "<div class='right'>";
} }
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); if (is_metaconsole() === true) {
echo '</div>'; echo '</div>';
}
echo '</form>'; echo '</form>';
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined filters') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no defined filters') ]);
} }
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&amp;pure='.$config['pure'].'">';
html_print_div( $submitButtons = '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=edit_filter&amp;pure='.$config['pure'].'">';
$submitButtons .= html_print_submit_button(
__('Create filter'),
'crt',
false,
[ [
'class' => 'action-buttons', 'icon' => 'wand',
'content' => html_print_submit_button( 'class' => 'mrgn_lft_15px',
__('Create filter'), ],
'crt', true
false, );
[ 'icon' => 'wand' ], $submitButtons .= '</form>';
true
), $submitButtons .= html_print_submit_button(
__('Delete'),
'delete_btn',
false,
[
'icon' => 'delete',
'class' => 'secondary',
'id' => 'delete-event-filters',
],
true
);
html_print_action_buttons(
$submitButtons,
[
'type' => 'form_action',
'id' => 'list-events-filters',
] ]
); );
echo '</form>';
?> ?>
<script type="text/javascript"> <script type="text/javascript">
@ -247,13 +267,17 @@ echo '</form>';
$('[id^=checkbox-all_delete]').change(function(){ $('[id^=checkbox-all_delete]').change(function(){
if ($("#checkbox-all_delete").prop("checked")) { if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected'); $('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
$(".check_delete").prop("checked", true); $("[id^=checkbox-delete_multiple]").prop("checked", true);
} }
else{ else{
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected'); $('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
$(".check_delete").prop("checked", false); $("[id^=checkbox-delete_multiple]").prop("checked", false);
} }
}); });
$('#button-delete_btn').click(function (e) {
$('#form-delete-filters').submit();
});
}); });

View File

@ -571,7 +571,7 @@ if ($load_filter_modal) {
$table->cellpadding = 4; $table->cellpadding = 4;
$table->styleTable = 'font-weight: bold; color: #555; text-align:left; border: 0px !important;'; $table->styleTable = 'font-weight: bold; color: #555; text-align:left; border: 0px !important;';
$table->class = 'databox'; $table->class = 'databox';
$filter_id_width = '200px'; $filter_id_width = '300px';
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
$table->cellspacing = 0; $table->cellspacing = 0;
$table->cellpadding = 0; $table->cellpadding = 0;
@ -596,32 +596,39 @@ if ($load_filter_modal) {
false, false,
'margin-left:5px; width:'.$filter_id_width.';' 'margin-left:5px; width:'.$filter_id_width.';'
); );
$data[1] = html_print_submit_button(
__('Load filter'),
'load_filter',
false,
[
'icon' => 'update',
'mode' => 'secondary mini',
],
true
);
$data[1] .= html_print_input_hidden('load_filter', 1, true);
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
html_print_table($table); html_print_table($table);
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Load filter'),
'load_filter',
false,
[
'icon' => 'update',
'mode' => 'secondary mini',
],
true
).html_print_input_hidden('load_filter', 1, true),
]
);
echo '</form>'; echo '</form>';
echo '</div>'; echo '</div>';
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function show_filter() { function show_filter() {
$("#load-filter-select").dialog({ $("#load-filter-select").dialog({
title: 'Load filter',
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: false, modal: false,
closeOnEscape: true, closeOnEscape: true,
width: 550 width: 340
}); });
} }
@ -764,24 +771,26 @@ if ($save_filter_modal) {
$data[0] = html_print_radio_button( $data[0] = html_print_radio_button(
'filter_mode', 'filter_mode',
'new', 'new',
'', __('New filter'),
true, true,
true true
).__('New filter').''; );
$data[1] = html_print_radio_button( $data[1] = html_print_radio_button(
'filter_mode', 'filter_mode',
'update', 'update',
'', __('Update filter'),
false, false,
true true
).__('Update filter').''; );
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
$data = []; $data = [];
$table->rowid[1] = 'save_filter_row1'; $table->rowid[1] = 'save_filter_row1';
$table->size[0] = '50%';
$table->size[1] = '50%';
$data[0] = '<b>'.__('Filter name').'</b>'.$jump; $data[0] = '<b>'.__('Filter name').'</b>'.$jump;
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true); $data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
if (is_metaconsole()) { if (is_metaconsole()) {
@ -832,14 +841,10 @@ if ($save_filter_modal) {
'', '',
'', '',
0, 0,
true true,
);
$data[1] = html_print_submit_button(
__('Update filter'),
'update_filter',
false, false,
'class="sub upd" onclick="save_update_filter();"', true,
true 'w130'
); );
$table->data[] = $data; $table->data[] = $data;
@ -863,10 +868,28 @@ if ($save_filter_modal) {
), ),
] ]
); );
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Update filter'),
'update_filter',
false,
[
'icon' => 'update',
'mode' => 'secondary mini',
'onClick' => 'save_update_filter();',
],
true
),
]
);
} else { } else {
include 'general/noaccess.php'; include 'general/noaccess.php';
} }
$modal_title = __('Save/Update filters');
echo '</div>'; echo '</div>';
?> ?>
<script type="text/javascript"> <script type="text/javascript">
@ -874,22 +897,26 @@ function show_save_filter() {
$('#save_filter_row1').show(); $('#save_filter_row1').show();
$('#save_filter_row2').show(); $('#save_filter_row2').show();
$('#update_filter_row1').hide(); $('#update_filter_row1').hide();
$('#button-update_filter').hide();
// Filter save mode selector // Filter save mode selector
$("[name='filter_mode']").click(function() { $("[name='filter_mode']").click(function() {
if ($(this).val() == 'new') { if ($(this).val() == 'new') {
$('#save_filter_row1').show(); $('#save_filter_row1').show();
$('#save_filter_row2').show(); $('#save_filter_row2').show();
$('#submit-save_filter').show(); $('#button-save_filter').show();
$('#update_filter_row1').hide(); $('#update_filter_row1').hide();
$('#button-update_filter').hide();
} }
else { else {
$('#save_filter_row1').hide(); $('#save_filter_row1').hide();
$('#save_filter_row2').hide(); $('#save_filter_row2').hide();
$('#update_filter_row1').show(); $('#update_filter_row1').show();
$('#submit-save_filter').hide(); $('#button-update_filter').show();
$('#button-save_filter').hide();
} }
}); });
$("#save-filter-select").dialog({ $("#save-filter-select").dialog({
title: '<?php echo $modal_title; ?>',
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: false, modal: false,

View File

@ -171,9 +171,20 @@ fieldset {
max-width: 10px; max-width: 10px;
} }
.fixed_filter_bar:has(div > div.filter-datatable-submain > form#events_form) {
margin-bottom: 0px;
}
.fixed_filter_bar > div.white_table_graph_header:has(div.filter_summary) {
padding: 5px 20px;
}
.filter_summary { .filter_summary {
margin-bottom: 3em; display: flex;
height: 3em; justify-content: end;
/* justify-content: space-around; */
width: 100%;
float: right;
} }
.filter_summary div.label { .filter_summary div.label {
@ -181,10 +192,10 @@ fieldset {
color: #fff; color: #fff;
font-weight: bolder; font-weight: bolder;
border-radius: 5px; border-radius: 5px;
padding: 0.5em; padding: 0.2em 0.5em;
} }
.filter_summary div.content { .filter_summary div.content {
padding: 0.5em; padding: 0.2em 0.5em;
} }
.filter_summary > div { .filter_summary > div {
@ -501,3 +512,13 @@ td:has(div#server_to_exec_label),
td:has(div#server_to_exec_value) { td:has(div#server_to_exec_value) {
padding: 0px; padding: 0px;
} }
table#save_filter_form,
table#load_filter_form {
padding: 0px;
}
td#save_filter_form-0-0 > input[type="radio"],
td#save_filter_form-0-1 > input[type="radio"] {
height: 14px;
}

View File

@ -1382,3 +1382,40 @@ select[multiple] option:active {
> .select2-results__option.select2-results__option--highlighted { > .select2-results__option.select2-results__option--highlighted {
background-color: #008d86; background-color: #008d86;
} }
.filter_summary > div,
.filter_summary > div > div.content {
background-color: #222 !important;
}
ul.datatable_filter:has(li > div.action-buttons) {
background-color: #222 !important;
}
span.ui-dialog-title {
color: #fff !important;
}
span.select2-dropdown.select2-dropdown--below {
z-index: 1200;
}
div.fixed_filter_bar,
div.white_table_graph_header {
border-radius: 0;
border-left: 0px;
border-right: 0px;
}
div.white_table_graph {
border-radius: 0;
}
div.white_box_opened[style*="height: 0px"],
div.white_box_opened[style*="height:0"] {
border: 0px;
}
div.white_box.white_box_opened.no_border {
border-radius: 0px;
}

View File

@ -639,7 +639,8 @@ tr#update_save_selector {
td#load_filter_form-0-0, td#load_filter_form-0-0,
td#load_filter_form-0-1, td#load_filter_form-0-1,
td#save_filter_form-1-0, td#save_filter_form-1-0,
td#save_filter_form-1-1 { td#save_filter_form-1-1,
td#save_filter_form-3-0 {
display: grid; display: grid;
} }
@ -657,7 +658,8 @@ tr#save_filter_row1 {
td#save_filter_form-0-0, td#save_filter_form-0-0,
td#save_filter_form-0-1, td#save_filter_form-0-1,
td#save_filter_form-1-0 > input#text-id_name, td#save_filter_form-1-0 > input#text-id_name,
td#save_filter_form-1-1 > span { td#save_filter_form-1-1 > span,
td#save_filter_form-3-0 > span {
width: 300px !important; width: 300px !important;
} }
@ -671,3 +673,41 @@ div.filter-datatable-submain > form > ul > li > label {
line-height: 16px; line-height: 16px;
font-size: 13px; font-size: 13px;
} }
table.events-filters-create > tbody > tr > td > div > label,
table.events-filters-create > tbody > tr > td > div.flex-row > div > label {
font-size: 13px;
line-height: 16px;
text-align: left;
}
table.events-filters-create > tbody > tr > td > div > input,
table.events-filters-create > tbody > tr > td > div > div,
table.events-filters-create > tbody > tr > td > div > select,
table.events-filters-create > tbody > tr > td > div > span,
table.events-filters-create > tbody > tr > td > div.flex-row > div > div {
margin-top: 10px;
}
table.events-filters-create
> tbody
> tr
> td
> div
> div
> .ui-autocomplete-input {
width: 94%;
}
table.events-filters-create > tbody > tr > td > div.flex-row > div {
width: 48%;
}
td:has(div > .no-margin-top) {
margin-top: 0px !important;
padding-top: 0px !important;
}
.no-margin-top {
margin-top: 0px !important;
}

View File

@ -2423,11 +2423,16 @@ try {
$table_id = 'table_events'; $table_id = 'table_events';
$form_id = 'events_form'; $form_id = 'events_form';
$show_hide_filters = '';
if ((int) $_GET['pure'] === 1) {
$show_hide_filters = 'invisible';
}
// Print datatable. // Print datatable.
html_print_div( html_print_div(
[ [
'class' => 'events_table_wrapper', 'class' => 'events_table_wrapper',
'style' => 'margin: 10px 10px 0;', 'style' => 'margin-top: 0px; margin-bottom: 0px;',
'content' => ui_print_datatable( 'content' => ui_print_datatable(
[ [
'id' => $table_id, 'id' => $table_id,
@ -2481,7 +2486,7 @@ try {
'drawCallback' => 'process_datatables_callback(this, settings)', 'drawCallback' => 'process_datatables_callback(this, settings)',
'print' => false, 'print' => false,
'csv' => 0, 'csv' => 0,
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar '.$show_hide_filters,
], ],
), ),
] ]
@ -3211,5 +3216,7 @@ $(document).ready(function () {
let moduleLabel = $('#text-module_search').prev(); let moduleLabel = $('#text-module_search').prev();
let moduleTip = $('#text-module_search').next().next(); let moduleTip = $('#text-module_search').next().next();
moduleLabel.append(moduleTip); moduleLabel.append(moduleTip);
$('.white_table_graph_header').first().append($('.filter_summary'));
}); });
</script> </script>