#11158 Fixed entities in agent name and icon size

This commit is contained in:
miguel angel rasteu 2023-05-10 12:53:03 +02:00
parent 476b38c221
commit 1fc0a43ca8
3 changed files with 17 additions and 3 deletions

View File

@ -765,7 +765,9 @@ if ($agents !== false) {
} }
if (empty($agent['alias']) === true) { if (empty($agent['alias']) === true) {
$agent['alias'] = $agent['nombre']; $agent['alias'] = io_safe_output($agent['nombre']);
} else {
$agent['alias'] = io_safe_output($agent['alias']);
} }
$additionalDataAgentName = []; $additionalDataAgentName = [];

View File

@ -74,8 +74,8 @@ if ($id) {
// Header Buttons. // Header Buttons.
$buttons = []; $buttons = [];
$buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Filter list')]).'</a>']; $buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit">'.html_print_image('images/logs@svg.svg', true, ['title' => __('Filter list'), 'main_menu_icon' => true]).'</a>'];
$buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit_form">'.html_print_image('images/plus@svg.svg', true, ['title' => __('Add filter')]).'</a>']; $buttons[] = ['text' => '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_edit_form">'.html_print_image('images/plus@svg.svg', true, ['title' => __('Add filter'), 'main_menu_icon' => true]).'</a>'];
// Header Caption. // Header Caption.
$headerTitle = ($id) ? __('Update filter') : __('Create filter'); $headerTitle = ($id) ? __('Update filter') : __('Create filter');
@ -96,6 +96,7 @@ ui_print_standard_header(
); );
if ($id) { if ($id) {
hd('id', true);
$filter = netflow_filter_get_filter($id); $filter = netflow_filter_get_filter($id);
$assign_group = $filter['id_group']; $assign_group = $filter['id_group'];
$name = $filter['id_name']; $name = $filter['id_name'];
@ -111,6 +112,7 @@ if ($id) {
$traffic_warning = $filter['traffic_warning']; $traffic_warning = $filter['traffic_warning'];
$netflow_monitoring_interval = $filter['netflow_monitoring_interval']; $netflow_monitoring_interval = $filter['netflow_monitoring_interval'];
} else { } else {
hd('no id', true);
$name = ''; $name = '';
$assign_group = ''; $assign_group = '';
$ip_dst = ''; $ip_dst = '';
@ -127,6 +129,7 @@ if ($id) {
} }
if ($update) { if ($update) {
hd('update', true);
$name = (string) get_parameter('name'); $name = (string) get_parameter('name');
$assign_group = (int) get_parameter('assign_group'); $assign_group = (int) get_parameter('assign_group');
$aggregate = get_parameter('aggregate', ''); $aggregate = get_parameter('aggregate', '');
@ -176,6 +179,7 @@ if ($update) {
} }
if ($create) { if ($create) {
hd('create', true);
$name = (string) get_parameter('name'); $name = (string) get_parameter('name');
$assign_group = (int) get_parameter('assign_group'); $assign_group = (int) get_parameter('assign_group');
$aggregate = get_parameter('aggregate', 'dstip'); $aggregate = get_parameter('aggregate', 'dstip');

View File

@ -4622,6 +4622,14 @@ function html_print_image(
$output .= 'data-use_title_for_force_title="1" '; $output .= 'data-use_title_for_force_title="1" ';
} }
if (isset($options['main_menu_icon']) && $options['main_menu_icon'] != '') {
if (isset($options['class'])) {
$options['class'] .= ' main_menu_icon';
} else {
$options['class'] = 'main_menu_icon';
}
}
// Valid attributes (invalid attributes get skipped). // Valid attributes (invalid attributes get skipped).
$attrs = [ $attrs = [
'height', 'height',