10408-Fix action column & 10398-Events pure mode

This commit is contained in:
Pablo Aragon 2023-03-28 12:39:02 +02:00
parent 061c9f8750
commit 5969928003
4 changed files with 50 additions and 21 deletions

View File

@ -729,7 +729,9 @@ function load_form_filter() {
$("#current_filter").text($('#filter_id option:selected').text()); $("#current_filter").text($('#filter_id option:selected').text());
// Search. // Search.
dt_events.draw(false); $("#table_events")
.DataTable()
.draw(false);
} }
$(document).ready (function() { $(document).ready (function() {

View File

@ -54,11 +54,6 @@ form.flex-row div.filter_input.large {
max-width: 100%; max-width: 100%;
} }
div.filter_input > label,
div.filter_input_little > label {
width: 10em;
}
form.flex-row > ul, form.flex-row > ul,
form.flex-row > ul > li, form.flex-row > ul > li,
form.flex-row > .box-shadow.white_table_graph { form.flex-row > .box-shadow.white_table_graph {
@ -504,7 +499,7 @@ div.multi-response-buttons {
} }
.events-refr { .events-refr {
width: 350px; width: 300px;
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: row-reverse; flex-direction: row-reverse;
@ -529,3 +524,29 @@ td#save_filter_form-0-1 > input[type="radio"] {
.module-search > input[type="text"] { .module-search > input[type="text"] {
margin-bottom: 6px; margin-bottom: 6px;
} }
div.agent-min-w100p > span {
width: 400px;
}
.events-pure {
display: block;
position: initial;
border-radius: 0px;
}
.events-pure > .white_table_graph_header {
height: 45px;
}
div.menu_tab_pure {
margin-top: 0px !important;
}
div#main_pure:has(.events-pure) {
width: 99%;
}
.margn-b-50px {
margin-bottom: 50px !important;
}

View File

@ -276,8 +276,8 @@ if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) che
['text' => 'Module'], ['text' => 'Module'],
['text' => 'Template'], ['text' => 'Template'],
[ [
'title' => __('Actions'), 'title' => __('Action'),
'text' => __('Actions'), 'text' => __('Action'),
'style' => 'min-width: 15%;', 'style' => 'min-width: 15%;',
], ],
['text' => 'Last fired'], ['text' => 'Last fired'],
@ -288,7 +288,7 @@ if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) che
$columns, $columns,
['agent_module_name'], ['agent_module_name'],
['template_name'], ['template_name'],
['actions'], ['action'],
['last_fired'], ['last_fired'],
['status'] ['status']
); );
@ -326,14 +326,14 @@ if (is_metaconsole() === true) {
1, 1,
2, 2,
3, 3,
7, -1,
]; ];
} else { } else {
$no_sortable_columns = [ $no_sortable_columns = [
0, 0,
1, 1,
2, 2,
6, -1,
]; ];
} }
} }

View File

@ -1376,7 +1376,7 @@ if ($pure) {
// Floating menu - Start. // Floating menu - Start.
echo '<div id="vc-controls" class="zindex999"">'; echo '<div id="vc-controls" class="zindex999"">';
echo '<div id="menu_tab">'; echo '<div id="menu_tab" class="menu_tab_pure">';
echo '<ul class="mn">'; echo '<ul class="mn">';
// Quit fullscreen. // Quit fullscreen.
@ -1922,7 +1922,7 @@ if ($id_agent !== null) {
} }
$data = ui_print_agent_autocomplete_input($params); $data = ui_print_agent_autocomplete_input($params);
$in = '<div class="filter_input"><label>'.__('Agent search'); $in = '<div class="filter_input agent-min-w100p"><label>'.__('Agent search');
$in .= '</label>'.$data.'</div>'; $in .= '</label>'.$data.'</div>';
$adv_inputs[] = $in; $adv_inputs[] = $in;
@ -2490,7 +2490,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 '.$show_hide_filters, 'filter_main_class' => 'events-pure box-flat white_table_graph fixed_filter_bar '.$show_hide_filters,
], ],
), ),
] ]
@ -3119,6 +3119,7 @@ $(document).ready( function() {
//Autorefresh in fullscreen //Autorefresh in fullscreen
var pure = '<?php echo $pure; ?>'; var pure = '<?php echo $pure; ?>';
var pure = '<?php echo $pure; ?>';
if(pure == 1){ if(pure == 1){
var refresh_interval = parseInt('<?php echo($config['refr'] * 1000); ?>'); var refresh_interval = parseInt('<?php echo($config['refr'] * 1000); ?>');
var until_time=''; var until_time='';
@ -3138,7 +3139,9 @@ $(document).ready( function() {
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>)', layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>)',
labels: ['', '', '', '', '', '', ''], labels: ['', '', '', '', '', '', ''],
onExpiry: function () { onExpiry: function () {
dt_events.draw(false); $("#table_events")
.DataTable()
.draw(false);
} }
}); });
} }
@ -3148,7 +3151,7 @@ $(document).ready( function() {
setInterval(events_refresh, refresh_interval); setInterval(events_refresh, refresh_interval);
$("select#refresh").change (function () { $("select#refresh").on('select2:select', function () {
var href = window.location.href; var href = window.location.href;
inputs = $("#events_form :input"); inputs = $("#events_form :input");
@ -3172,6 +3175,13 @@ $(document).ready( function() {
$(document).attr("location", href); $(document).attr("location", href);
}); });
$("div.events-pure").removeClass("fixed_filter_bar invisible");
$("div#principal_action_buttons").addClass("w100p");
$("table#table_events").addClass("margn-b-50px");
$('#refresh').val('<?php echo $config['refr']; ?>').trigger('change');
} }
}); });
@ -3213,10 +3223,6 @@ function show_instructions(id){
} }
$(document).ready(function () { $(document).ready(function () {
let agentLabel = $('#text-text_agent').prev();
let agentTip = $('#text-text_agent').next();
agentLabel.append(agentTip);
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);