Merge branch 'ent-9662-Restyling-fuentes-colores-botones' of brutus.artica.es:artica/pandorafms into ent-9662-Restyling-fuentes-colores-botones

This commit is contained in:
Jose Gonzalez 2023-02-24 10:20:11 +01:00
commit d80dd284ab
12 changed files with 509 additions and 267 deletions

View File

@ -602,7 +602,14 @@ function mainAgentsModules()
$show_filters .= '</form>';
ui_toggle(
$show_filters,
__('Filters ').ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true)
__('Filters ').ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true),
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
}

View File

@ -74,61 +74,11 @@ function pandora_realtime_graphs()
);
}
$chart[time()]['graph'] = '0';
$interactive_graph = true;
$color = [];
$legend = '';
$long_index = [];
$no_data_image = '';
$canvas = '<div id="graph_container" class="graph_container">';
$canvas .= '<div id="chartLegend" class="chartLegend"></div>';
$width = 800;
$height = 300;
$data_array['realtime']['data'][0][0] = (time() - 10);
$data_array['realtime']['data'][0][1] = 0;
$data_array['realtime']['data'][1][0] = time();
$data_array['realtime']['data'][1][1] = 0;
$data_array['realtime']['color'] = 'green';
$params = [
'agent_module_id' => false,
'period' => 300,
'width' => $width,
'height' => $height,
'unit' => $unit,
'only_image' => $only_image,
'homeurl' => $homeurl,
'type_graph' => 'area',
'font' => $config['fontpath'],
'font-size' => $config['font_size'],
'array_data_create' => $data_array,
'show_legend' => false,
'show_menu' => false,
];
$canvas .= grafico_modulo_sparse($params);
$canvas .= '</div>';
echo $canvas;
$table = new stdClass();
$table->width = '100%';
$table->id = 'table-form';
$table->class = 'databox filters';
$table->class = 'filter-table-adv';
$table->style = [];
$table->cellpadding = '0';
$table->cellspacing = '0';
$table->style['graph'] = 'font-weight: bold;';
$table->style['refresh'] = 'font-weight: bold;';
$table->style['incremental'] = 'font-weight: bold;';
$table->style['reset'] = 'font-weight: bold;';
$table->style['snmp_address'] = 'font-weight: bold;';
$table->style['snmp_community'] = 'font-weight: bold;';
$table->style['snmp_oid'] = 'font-weight: bold;';
$table->style['snmp_oid'] = 'font-weight: bold;';
$table->data = [];
$graph_fields['cpu_load'] = __('%s Server CPU', get_product_name());
@ -158,15 +108,22 @@ function pandora_realtime_graphs()
$refresh = get_parameter('refresh', '1000');
if ($graph != 'snmp_module') {
$data['graph'] = __('Graph').'&nbsp;&nbsp;';
$data['graph'] .= html_print_select(
$graph_fields,
'graph',
$graph,
'',
'',
0,
true
$data['graph'] = html_print_label_input_block(
__('Graph'),
html_print_select(
$graph_fields,
'graph',
$graph,
'',
'',
0,
true,
false,
true,
'',
false,
'width: 100%'
)
);
}
@ -179,18 +136,35 @@ function pandora_realtime_graphs()
$agent_alias = io_safe_output(get_parameter('agent_alias', ''));
$module_name = io_safe_output(get_parameter('module_name', ''));
$module_incremental = get_parameter('incremental', 0);
$data['module_info'] = $agent_alias.': <b>'.$module_name.'</b>';
// Append all the hidden in this cell.
$data['module_info'] .= html_print_input_hidden(
'incremental',
$module_incremental,
true
$data['module_info'] = html_print_label_input_block(
$agent_alias.': '.$module_name,
html_print_input_hidden(
'incremental',
$module_incremental,
true
).html_print_select(
['snmp_module' => '-'],
'graph',
'snmp_module',
'',
'',
0,
true,
false,
true,
'',
false,
'width: 100%; display: none;'
)
);
$data['module_info'] .= html_print_select(
['snmp_module' => '-'],
'graph',
'snmp_module',
}
$data['refresh'] = html_print_label_input_block(
__('Refresh interval'),
html_print_select(
$refresh_fields,
'refresh',
$refresh,
'',
'',
0,
@ -199,33 +173,17 @@ function pandora_realtime_graphs()
true,
'',
false,
'display: none;'
'width: 100%'
)
);
if ($graph != 'snmp_module') {
$data['incremental'] = html_print_label_input_block(
__('Incremental'),
html_print_checkbox_switch('incremental', 1, 0, true)
);
}
$data['refresh'] = __('Refresh interval').'&nbsp;&nbsp;';
$data['refresh'] .= html_print_select(
$refresh_fields,
'refresh',
$refresh,
'',
'',
0,
true
);
if ($graph != 'snmp_module') {
$data['incremental'] = __('Incremental').'&nbsp;&nbsp;';
$data['incremental'] .= html_print_checkbox('incremental', 1, 0, true);
}
$data['reset'] = html_print_button(
__('Clear graph'),
'reset',
false,
'javascript:realtimeGraphs.clearGraph();',
'class="sub delete mgn_tp_0" ',
true
);
$table->data[] = $data;
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
@ -236,9 +194,71 @@ function pandora_realtime_graphs()
html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
// Print the form.
echo '<form id="realgraph" method="post">';
html_print_table($table);
echo '</form>';
$searchForm = '<form id="realgraph" method="post">';
$searchForm .= html_print_table($table, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Clear graph'),
'srcbutton',
false,
[
'icon' => 'delete',
'mode' => 'mini',
'onClick' => 'javascript:realtimeGraphs.clearGraph();',
],
true
),
],
true
);
$searchForm .= '</form>';
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
$chart[time()]['graph'] = '0';
$canvas = '<div id="graph_container" class="graph_container">';
$canvas .= '<div id="chartLegend" class="chartLegend"></div>';
$width = 800;
$height = 300;
$data_array['realtime']['data'][0][0] = (time() - 10);
$data_array['realtime']['data'][0][1] = 0;
$data_array['realtime']['data'][1][0] = time();
$data_array['realtime']['data'][1][1] = 0;
$data_array['realtime']['color'] = 'green';
$params = [
'agent_module_id' => false,
'period' => 300,
'width' => $width,
'height' => $height,
'only_image' => false,
'type_graph' => 'area',
'font' => $config['fontpath'],
'font-size' => $config['font_size'],
'array_data_create' => $data_array,
'show_legend' => false,
'show_menu' => false,
'backgroundColor' => 'transparent',
];
$canvas .= grafico_modulo_sparse($params);
$canvas .= '</div>';
echo $canvas;
// Define a custom action to save
// the OID selected in the SNMP browser to the form.

View File

@ -12,6 +12,5 @@
#graph_container {
width: 800px;
margin: 20px auto;
background-color: white;
border-radius: 3px;
}

View File

@ -220,7 +220,7 @@ if ($edit_filter > -2) {
if ($j == 1) {
$table->data[$j][1] .= ui_print_help_tip(__('This field contains a substring, could be part of a IP address, a numeric OID, or a plain substring').SEPARATOR_COLUMN, true);
} else {
$table->data[$j][1] .= html_print_image('images/cross.png', true, ['id' => 'delete_filter_'.$f['id_snmp_filter'], 'class' => 'invert_filter', 'alt' => __('Click to remove the filter')]);
$table->data[$j][1] .= html_print_image('images/delete.svg', true, ['id' => 'delete_filter_'.$f['id_snmp_filter'], 'class' => 'invert_filter main_menu_icon', 'alt' => __('Click to remove the filter')]);
}
$j++;
@ -298,7 +298,7 @@ if ($edit_filter > -2) {
$data = [];
$data[0] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.$r['description'].'</a>';
$data[1] = $r['filter'];
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter']).'</a>';
$data[2] = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/support@svg.svg', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter main_menu_icon']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/delete.svg', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
array_push($table->data, $data);
}
} else {
@ -309,7 +309,7 @@ if ($edit_filter > -2) {
foreach ($row as $i => $r) {
if ($ind2 == 0) {
$compose_id = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.$r['description'].'</a>';
$compose_action = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter']).'</a>';
$compose_action = '<a href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&edit_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/support@svg.svg', true, ['border' => '0', 'alt' => __('Update'), 'class' => 'invert_filter main_menu_icon']).'</a>'.'&nbsp;&nbsp;<a onclick="if (confirm(\''.__('Are you sure?').'\')) return true; else return false;" href="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_filters&delete_filter='.$r['id_snmp_filter'].'">'.html_print_image('images/delete.svg', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
$ind2++;
}
@ -358,7 +358,7 @@ if ($edit_filter > -2) {
$(document).ready (function () {
$('#add_filter').click(function(e) {
$('#filter_table').append('<tr id="filter_table-' + id + '" class="datos"><td id="filter_table-' + id + '-0" class="datos "></td><td id="filter_table-' + id + '-1" class="datos "><input type="text" name="filter_' + id + '" value="" id="text-filter_' + id + '" size="60" maxlength="100"><img src="' + homeurl + 'images/cross.png" onclick="delete_this_row(' + id + ');" data-title="Click to delete the filter" data-use_title_for_force_title="1" class="forced_title" alt="Click to delete the filter"></td></tr>');
$('#filter_table').append('<tr id="filter_table-' + id + '" class="datos"><td id="filter_table-' + id + '-0" class="datos "></td><td id="filter_table-' + id + '-1" class="datos "><input type="text" name="filter_' + id + '" value="" id="text-filter_' + id + '" size="60" maxlength="100"><img src="' + homeurl + 'images/delete.svg" onclick="delete_this_row(' + id + ');" data-title="Click to delete the filter" data-use_title_for_force_title="1" class="forced_title main_menu_icon" alt="Click to delete the filter"></td></tr>');
id++;

View File

@ -79,69 +79,84 @@ if ($generate_trap) {
$table = new stdClass();
$traps_generator = '<form method="POST" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_trap_generator">';
$table->width = '100%';
$table->class = 'databox filters';
$table->class = 'filter-table-adv';
$table->size = [];
$table->data = [];
$table->size[0] = '30%';
$table->size[1] = '30%';
$table->size[2] = '30%';
$table->data[0][0] = __('Host address');
$table->data[0][1] = html_print_input_text(
'snmp_host_address',
$snmp_host_address,
'',
50,
255,
true
$table->data[0][0] = html_print_label_input_block(
__('Host address'),
html_print_input_text(
'snmp_host_address',
$snmp_host_address,
'',
50,
255,
true
)
);
$table->data[0][2] = __('Community');
$table->data[0][3] = html_print_input_text(
'snmp_community',
$snmp_community,
'',
50,
255,
true
$table->data[0][1] = html_print_label_input_block(
__('Community'),
html_print_input_text(
'snmp_community',
$snmp_community,
'',
50,
255,
true
)
);
$table->data[2][0] = __('Enterprise String');
$table->data[2][1] = html_print_input_text(
'snmp_oid',
$snmp_oid,
'',
50,
255,
true
$table->data[0][2] = html_print_label_input_block(
__('Enterprise String'),
html_print_input_text(
'snmp_oid',
$snmp_oid,
'',
50,
255,
true
)
);
$table->data[2][2] = __('Value');
$table->data[2][3] = html_print_input_text(
'snmp_value',
$snmp_value,
'',
50,
255,
true
$table->data[1][1] = html_print_label_input_block(
__('Value'),
html_print_input_text(
'snmp_value',
$snmp_value,
'',
50,
255,
true
)
);
$table->data[3][0] = __('SNMP Agent');
$table->data[3][1] = html_print_input_text(
'snmp_agent',
$snmp_agent,
'',
50,
255,
true
);
$table->data[3][2] = __('SNMP Type');
$table->data[3][3] = html_print_input_text(
'snmp_type',
$snmp_type,
'',
50,
255,
true
$table->data[1][2] = html_print_label_input_block(
__('SNMP Agent'),
html_print_input_text(
'snmp_agent',
$snmp_agent,
'',
50,
255,
true
)
);
/*
$table->data[1][3] = html_print_label_input_block(
__('SNMP Type'),
html_print_input_text(
'snmp_type',
$snmp_type,
'',
50,
255,
true
)
);*/
$types = [
0 => 'Cold start (0)',
@ -152,24 +167,50 @@ $types = [
5 => 'EGP neighbor loss (5)',
6 => 'Enterprise (6)',
];
$table->data[3][3] = html_print_select(
$types,
'snmp_type',
$snmp_type,
'',
__('Select'),
-1,
true,
false,
false
$table->data[1][3] = html_print_label_input_block(
__('SNMP Type'),
html_print_select(
$types,
'snmp_type',
$snmp_type,
'',
__('Select'),
-1,
true,
false,
false,
'',
false,
'width: 100%'
)
);
$searchForm = '<form method="POST" action="index.php?sec=snmpconsole&sec2=godmode/snmpconsole/snmp_trap_generator">';
$searchForm .= html_print_table($table, true);
$searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Generate trap'),
'btn_generate_trap',
false,
['class' => 'sub cog'],
true
),
],
true
);
$searchForm .= html_print_input_hidden('generate_trap', 1, true);
$searchForm .= '</form>';
$traps_generator .= html_print_table($table, true);
$traps_generator .= '<div style="width:'.$table->width.'; text-align: right;">'.html_print_submit_button(__('Generate trap'), 'btn_generate_trap', false, 'class="sub cog"', true).'</div>';
$traps_generator .= html_print_input_hidden('generate_trap', 1, true);
unset($table);
$traps_generator .= '</form>';
echo $traps_generator;
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Trap').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: sketchtool 61.2 (101010) - https://sketch.com -->
<title>EF4DAB07-B64C-4C55-97AB-23DF4EA7EF22@svg</title>
<desc>Created with sketchtool.</desc>
<g id="Login---v2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Mockup---login-v4h" transform="translate(-162.000000, -25.000000)" fill="#8190AD">
<g id="Extra-links" transform="translate(20.000000, 20.000000)">
<g id="Group" transform="translate(142.000000, 5.000000)">
<g id="Support">
<path fill="#3F3F3F" d="M15.2701641,-1.77635684e-15 C15.4858494,-1.27409902e-15 15.6979436,0.0348396041 15.8989225,0.101403078 L12.7070316,3.29366835 C12.3167579,3.68432574 12.3167579,4.31737481 12.7070316,4.7080322 L14.6666667,6.66808379 L15.2912682,7.29281808 C15.6515751,7.65347905 16.2187925,7.68127953 16.6111153,7.37629716 L16.7053314,7.29311863 C16.7053816,7.29306854 16.7054316,7.29301844 16.7053314,7.29281808 L19.898705,4.10024399 C19.9485744,4.25090439 19.9806182,4.40780887 19.9935232,4.56778861 L20,4.72867607 L20,9.00123799 L16.0046868,13 L10.9984579,13 L10.497,12.499 L2.98434067,19.9968645 L0,19.9968645 L0,16.9968645 L7.499,9.5 L7,9.00123799 L7,4.00313044 L10.9984579,-1.77635684e-15 L15.2701641,-1.77635684e-15 Z"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -569,7 +569,7 @@ if ($load_filter_modal) {
$table->width = '100%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
$table->styleTable = 'font-weight: bold; color: #555; text-align:left; border: 0px !important;';
$table->class = 'databox';
$filter_id_width = '200px';
if (is_metaconsole() === true) {
@ -581,7 +581,7 @@ if ($load_filter_modal) {
$data = [];
$table->rowid[3] = 'update_filter_row1';
$data[0] = __('Load filter').$jump;
$data[0] = '<b>'.__('Load filter').'</b>'.$jump;
$data[0] .= html_print_select(
$filters,
'filter_id',
@ -621,7 +621,7 @@ function show_filter() {
draggable: true,
modal: false,
closeOnEscape: true,
width: 450
width: 550
});
}
@ -754,9 +754,9 @@ if ($save_filter_modal) {
$table->cellpadding = 0;
}
$table->styleTable = 'font-weight: bold; text-align:left;';
$table->styleTable = 'font-weight: bold; text-align:left; border: 0px !important;';
if (is_metaconsole() === false) {
$table->style[0] = 'width: 50%; width:50%;';
$table->style[0] = '';
}
$data = [];
@ -782,12 +782,12 @@ if ($save_filter_modal) {
$data = [];
$table->rowid[1] = 'save_filter_row1';
$data[0] = __('Filter name').$jump;
$data[0] = '<b>'.__('Filter name').'</b>'.$jump;
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
if (is_metaconsole()) {
$data[1] = __('Save in Group').$jump;
} else {
$data[1] = __('Filter group').$jump;
$data[1] = '<b>'.__('Filter group').'</b>'.$jump;
}
$user_groups_array = users_get_groups_for_select(
@ -893,7 +893,8 @@ function show_save_filter() {
resizable: true,
draggable: true,
modal: false,
closeOnEscape: true
closeOnEscape: true,
width: 700
});
}

View File

@ -230,14 +230,14 @@ class AgentsAlerts extends HTML
$agent_modules = db_get_all_rows_sql($sql);
ui_pagination(
$tablePagination = ui_pagination(
$count_agent_module[0]['COUNT(tagente_modulo.nombre)'],
ui_get_url_refresh(),
0,
false,
false,
'offset',
true,
'offset',
false,
'',
'',
false,
@ -419,6 +419,11 @@ class AgentsAlerts extends HTML
}
html_print_table($table);
html_print_action_buttons(
'',
['right_content' => $tablePagination]
);
}
@ -781,7 +786,7 @@ class AgentsAlerts extends HTML
'name' => 'show-modules-without-alerts',
'checked' => $this->showWithoutAlertModules,
'input_class' => 'flex-row',
'type' => 'checkbox',
'type' => 'switch',
'class' => '',
'disabled_hidden' => true,
'return' => true,
@ -858,13 +863,16 @@ class AgentsAlerts extends HTML
true
);
// Prints the header controls.
$header = html_print_div(
[
'class' => 'white_box agents_alerts_header',
'content' => $filterForm,
],
true
$header = ui_toggle(
$filterForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
true,
true,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
echo $header;

View File

@ -752,7 +752,7 @@ function filemanager_file_explorer(
&& ($readOnly === false)
) {
$data[4] .= '<form method="post" action="'.$url.'" style="">';
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter" src="images/cross.png" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[4] .= '<input type="image" style="margin-top: 2px;height:21px" class="invert_filter" src="images/delete.svg" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['server_unique_identifier']), true);
$data[4] .= html_print_input_hidden('delete_file', 1, true);

View File

@ -3449,6 +3449,14 @@ function ui_print_datatable(array $parameters)
$parameters['paging'] = true;
}
if (!isset($parameters['filter_main_class'])) {
$parameters['filter_main_class'] = '';
}
if (!isset($parameters['toggle_collapsed'])) {
$parameters['toggle_collapsed'] = true;
}
$no_sortable_columns = json_encode([]);
if (isset($parameters['no_sortable_columns'])) {
$no_sortable_columns = json_encode($parameters['no_sortable_columns']);
@ -3559,7 +3567,7 @@ function ui_print_datatable(array $parameters)
$filter .= $parameters['form']['html'];
}
$filter .= '<ul class="datatable_filter content filter_table">';
$filter .= '<ul class="datatable_filter content filter_table no_border">';
foreach ($parameters['form']['inputs'] as $input) {
$filter .= html_print_input(($input + ['return' => true]), 'li');
@ -3568,19 +3576,21 @@ function ui_print_datatable(array $parameters)
$filter .= '<li>';
// Extra buttons.
$extra_buttons = '';
if (isset($parameters['form']['extra_buttons']) === true
&& is_array($parameters['form']['extra_buttons']) === true
) {
foreach ($parameters['form']['extra_buttons'] as $button) {
$filter .= html_print_button(
$extra_buttons .= html_print_button(
$button['text'],
$button['id'],
false,
$button['onclick'],
[
'style' => ($button['style'] ?? ''),
'mode' => 'link',
'mode' => 'secondary mini',
'class' => $button['class'],
'icon' => $button['icon'],
],
true
);
@ -3601,7 +3611,7 @@ function ui_print_datatable(array $parameters)
'class' => $search_button_class,
],
true
),
).$extra_buttons,
],
true
);
@ -3612,25 +3622,27 @@ function ui_print_datatable(array $parameters)
if (isset($parameters['form']['no_toggle']) === false) {
$filter = ui_toggle(
$filter,
'<span class="subsection_header_title">'.__('Filter').'</span>',
'<span class="subsection_header_title">'.__('Filters').'</span>',
'',
'',
true,
$parameters['toggle_collapsed'],
false,
'white_box white_box_opened fixed_filter_content',
'no-border'
'',
'no-border filter-datatable-submain',
'filter-datatable-main '.$parameters['filter_main_class']
);
}
} else if (isset($parameters['form_html'])) {
$filter = ui_toggle(
$parameters['form_html'],
'<span class="subsection_header_title">'.__('Filter').'</span>',
'<span class="subsection_header_title">'.__('Filters').'</span>',
'',
'',
true,
$parameters['toggle_collapsed'],
false,
'white_box white_box_opened fixed_filter_bar',
'no-border'
'',
'no-border filter-datatable-submain',
'box-float white_table_graph filter-datatable-main '.$parameters['filter_main_class']
);
}

View File

@ -557,3 +557,100 @@ table.filter-table-adv td > div .label-thin {
color: #3f3f3f;
font-weight: 400;
}
/*
padding-right: calc(100% - 1024px);
*/
div.filter-datatable-submain {
padding: 10px 25px;
}
div.filter-datatable-submain > form > div.filter_input {
max-width: 20%;
display: grid;
justify-content: initial;
}
div.filter-datatable-submain > form {
align-items: flex-start;
}
div.filter-datatable-submain > form > div.filter_input > label,
div.advanced-options-events > div.filter_input > label {
font-size: 13px;
line-height: 16px;
font-weight: bold;
margin-bottom: 10px;
}
div.filter-datatable-submain > form > div.filter_input,
div.advanced-options-events > div.filter_input {
margin-bottom: 10px !important;
}
.display-initial {
display: initial;
/* margin-bottom: 10px; */
}
.vert-align-bottom {
vertical-align: bottom;
}
label.vert-align-bottom > a.tip {
vertical-align: middle;
}
div.display-initial > a.tip {
vertical-align: bottom;
}
div.advanced-options-events > div.filter_input {
display: grid !important;
}
div.advanced-options-events > div.filter_input input {
width: 400px;
}
div.advanced-options-events > div.filter_input.large {
display: flex !important;
}
div.filter_input > div.datetime-adv-opt > input.hasDatepicker {
width: 193px !important;
}
div.filter_input > div.datetime-adv-opt > span {
padding: 0px 5px;
}
tr#update_save_selector {
display: block;
}
td#load_filter_form-0-0,
td#load_filter_form-0-1,
td#save_filter_form-1-0,
td#save_filter_form-1-1 {
display: grid;
}
td#load_filter_form-0-0 > b,
td#save_filter_form-1-0 > b {
padding-bottom: 10px;
font-size: 13px;
line-height: 16px;
}
tr#save_filter_row1 {
display: flex !important;
}
td#save_filter_form-0-0,
td#save_filter_form-0-1,
td#save_filter_form-1-0 > input#text-id_name,
td#save_filter_form-1-1 > span {
width: 300px !important;
}

View File

@ -1655,11 +1655,57 @@ $data = html_print_input(
'selected' => $id_group,
'nothing' => false,
'return' => true,
'size' => '80%',
'size' => '100%',
]
);
$in = '<div class="filter_input"><label>'.__('Group').'</label>';
$in .= $data.'</div>';
$in .= $data;
// Search recursive groups.
$data = html_print_checkbox_switch(
'search_recursive_groups',
$search_recursive_groups,
$search_recursive_groups,
true,
false,
'checked_slide_events(this);',
true
);
$in_group = '<div class="display-initial">';
$in_group .= $data;
$in_group .= '<label class="vert-align-bottom pdd_r_20px">';
$in_group .= __('Group recursion');
$in_group .= ui_print_help_tip(
__('WARNING: This could cause a performace impact.'),
true
);
$in_group .= '</label>';
$in .= $in_group;
// Search secondary groups.
$data = html_print_checkbox_switch(
'search_secondary_groups',
$search_secondary_groups,
$search_secondary_groups,
true,
false,
'checked_slide_events(this);',
true
);
$in_sec_group .= $data;
$in_sec_group .= '<label class="vert-align-bottom">';
$in_sec_group .= __('Search in secondary groups');
$in_sec_group .= ui_print_help_tip(
__('WARNING: This could cause a performace impact.'),
true
);
$in_sec_group .= '</label>';
$in_sec_group .= '</div>';
$in .= $in_sec_group;
$in .= '</div>';
$inputs[] = $in;
// Event type.
@ -1726,11 +1772,9 @@ $inputs[] = $in;
// Free search.
$data = html_print_input_text('search', $search, '', '', 255, true);
// Search recursive groups.
$data .= ui_print_help_tip(
__('Search for elements NOT containing given text.'),
true
);
$data .= '<div class="display-initial">';
$data .= html_print_checkbox_switch(
'not_search',
$not_search,
@ -1740,6 +1784,13 @@ $data .= html_print_checkbox_switch(
'checked_slide_events(this);',
true
);
$data .= ui_print_help_tip(
__('Search for elements NOT containing given text.'),
true
);
$data .= '</div>';
$in = '<div class="filter_input filter_input_not_search"><label>'.__('Free search').'</label>';
$in .= $data;
$in .= '</div>';
@ -1774,52 +1825,8 @@ $in = '<div class="filter_input"><label>'.__('Severity').'</label>';
$in .= $data.'</div>';
$inputs[] = $in;
// Search recursive groups.
$data = html_print_checkbox_switch(
'search_recursive_groups',
$search_recursive_groups,
$search_recursive_groups,
true,
false,
'checked_slide_events(this);',
true
);
$in = '<div class="filter_input filter_input_switch"><label>';
$in .= __('Group recursion');
$in .= ui_print_help_tip(
__('WARNING: This could cause a performace impact.'),
true
);
$in .= '</label>';
$in .= $data;
$in .= '</div>';
$inputs[] = $in;
// Search secondary groups.
$data = html_print_checkbox_switch(
'search_secondary_groups',
$search_secondary_groups,
$search_secondary_groups,
true,
false,
'checked_slide_events(this);',
true
);
$in = '<div class="filter_input filter_input_switch"><label>';
$in .= __('Search in secondary groups');
$in .= ui_print_help_tip(
__('WARNING: This could cause a performace impact.'),
true
);
$in .= '</label>';
$in .= $data;
$in .= '</div>';
$inputs[] = $in;
// Trick view in table.
$inputs[] = '<div class="w100p"></div>';
$inputs[] = '<div class="w100p pdd_t_15px"></div>';
$buttons = [];
@ -1828,14 +1835,16 @@ $buttons[] = [
'class' => 'float-left margin-right-2',
'text' => __('Load filter'),
'onclick' => '',
'icon' => 'search',
];
if ($event_w === true || $event_m === true) {
$buttons[] = [
'id' => 'save-filter',
'class' => 'float-left margin-right-2',
'class' => 'margin-right-2',
'text' => __('Save filter'),
'onclick' => '',
'icon' => 'search',
];
}
@ -1908,8 +1917,9 @@ if ($id_agent !== null) {
}
$data = ui_print_agent_autocomplete_input($params);
$in = '<div class="filter_input"><label>'.__('Agent search').'</label>';
$in .= $data.'</div>';
$in = '<div class="filter_input"><label>'.__('Agent search');
$in .= '</label>'.$data.'</div>';
$adv_inputs[] = $in;
// Mixed. Metaconsole => server, Console => module.
@ -1962,7 +1972,12 @@ $data = html_print_select(
'',
__('Any'),
0,
true
true,
false,
true,
'',
false,
'width: 400px'
);
$in = '<div class="filter_input"><label>'.__('User ack.').'</label>';
$in .= $data.'</div>';
@ -1975,7 +1990,12 @@ $data = html_print_select(
'',
__('Any'),
0,
true
true,
false,
true,
'',
false,
'width: 400px'
);
$in = '<div class="filter_input"><label>'.__('Owner').'</label>';
$in .= $data.'</div>';
@ -1992,7 +2012,12 @@ $data = html_print_select(
'',
__('All'),
-1,
true
true,
false,
true,
'',
false,
'width: 400px'
);
$adv_inputs[] = html_print_div(
@ -2079,7 +2104,7 @@ $adv_inputs[] = html_print_div(
[
'class' => 'filter_input',
'content' => sprintf(
'<label>%s</label>%s<span>:</span>%s',
'<label>%s</label><div class="datetime-adv-opt">%s<span>:</span>%s</div>',
__('From (date:time)'),
$inputDateFrom,
$inputTimeFrom
@ -2137,7 +2162,7 @@ $adv_inputs[] = html_print_div(
[
'class' => 'filter_input',
'content' => sprintf(
'<label>%s</label>%s<span>:</span>%s',
'<label>%s</label><div class="datetime-adv-opt">%s<span>:</span>%s</div>',
__('To (date:time)'),
$inputDateTo,
$inputTimeTo
@ -2157,7 +2182,12 @@ $custom_data_filter_type_input = html_print_select(
'',
false,
-1,
true
true,
false,
true,
'',
false,
'width: 400px'
);
$adv_inputs[] = html_print_div(
@ -2217,8 +2247,8 @@ $filter .= ui_toggle(
'',
true,
true,
'white_box white_box_opened',
'no-border flex-row',
'white_box white_box_opened no_border',
'advanced-options-events no-border flex-row',
'box-flat white_table_graph w100p'
);
@ -2451,6 +2481,7 @@ try {
'drawCallback' => 'process_datatables_callback(this, settings)',
'print' => false,
'csv' => 0,
'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
],
),
]
@ -3172,4 +3203,13 @@ function show_instructions(id){
});
}
$(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 moduleTip = $('#text-module_search').next().next();
moduleLabel.append(moduleTip);
});
</script>