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-16 13:31:22 +01:00
commit ad5078fcc0
6 changed files with 177 additions and 122 deletions

View File

@ -907,12 +907,12 @@ if ($agents !== false) {
$agentDisableEnableTitle = __('Enable agent'); $agentDisableEnableTitle = __('Enable agent');
$agentDisableEnableAction = 'enable_agent'; $agentDisableEnableAction = 'enable_agent';
$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-pause.svg'; $agentDisableEnableIcon = 'change-active.svg';
} else { } else {
$agentDisableEnableTitle = __('Disable agent'); $agentDisableEnableTitle = __('Disable agent');
$agentDisableEnableAction = 'disable_agent'; $agentDisableEnableAction = 'disable_agent';
$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-active.svg'; $agentDisableEnableIcon = 'change-pause.svg';
} }
$agentActionButtons[] = html_print_menu_button( $agentActionButtons[] = html_print_menu_button(

View File

@ -178,18 +178,18 @@ $select_in = html_print_select(
$table_ichanges = '<table> $table_ichanges = '<table>
<tr> <tr>
<td>'.__('Out of black list').'</td> <td style="width: 45%">'.__('Out of black list').'</td>
<td></td> <td style="width: 10%"></td>
<td>'.__('In black list').'</td> <td style="width: 45%">'.__('In black list').'</td>
</tr> </tr>
<tr> <tr>
<td>'.$select_out.'</td> <td style="width: 45%">'.$select_out.'</td>
<td> <td style="width: 10%">
<a href="javascript:">'.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 180deg;', 'id' => 'right_iblacklist', 'alt' => __('Push selected modules into blacklist'), 'title' => __('Push selected modules into blacklist'), 'class' => 'main_menu_icon invert_filter']).'</a> <a href="javascript:">'.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 180deg;', 'id' => 'right_iblacklist', 'alt' => __('Push selected modules into blacklist'), 'title' => __('Push selected modules into blacklist'), 'class' => 'main_menu_icon invert_filter']).'</a>
<br><br> <br><br>
<a href="javascript:">'.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 0', 'id' => 'left_iblacklist', 'alt' => __('Pop selected modules out of blacklist'), 'title' => __('Pop selected modules out of blacklist'), 'class' => 'main_menu_icon invert_filter']).'</a> <a href="javascript:">'.html_print_image('images/arrow@svg.svg', true, ['style' => 'rotate: 0', 'id' => 'left_iblacklist', 'alt' => __('Pop selected modules out of blacklist'), 'title' => __('Pop selected modules out of blacklist'), 'class' => 'main_menu_icon invert_filter']).'</a>
</td> </td>
<td>'.$select_in.'</td> <td style="width: 45%">'.$select_in.'</td>
</tr> </tr>
</table>'; </table>';
@ -680,7 +680,7 @@ $table->data[$i][] = html_print_label_input_block(
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">'; echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo '<fieldset>'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('General options').'</legend>'; echo '<legend>'.__('General options').'</legend>';
html_print_input_hidden('update_config', 1); html_print_input_hidden('update_config', 1);
@ -695,7 +695,7 @@ $encryption = [
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset>'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Mail configuration').'</legend>'; echo '<legend>'.__('Mail configuration').'</legend>';
ui_print_warning_message( ui_print_warning_message(

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -37,46 +37,66 @@ $update = (bool) get_parameter('update');
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->border = 0; $table->border = 0;
$table->cellspacing = 3;
$table->cellpadding = 5;
$table->class = 'databox filters';
$table->data = []; $table->data = [];
$table->data[0][0] = '<b>'.__('Data storage path').'</b>'; $table->data[0][] = html_print_label_input_block(
$table->data[0][1] = html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true); __('Data storage path'),
html_print_input_text('netflow_path', $config['netflow_path'], false, 50, 200, true)
);
$table->data[1][0] = '<b>'.__('Daemon interval').'</b>'; $table->data[0][] = html_print_label_input_block(
$table->data[1][1] = html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true); __('Daemon interval'),
html_print_input_text('netflow_interval', $config['netflow_interval'], false, 50, 200, true)
);
$table->data[2][0] = '<b>'.__('Daemon binary path').'</b>'; $table->data[1][] = html_print_label_input_block(
$table->data[2][1] = html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true); __('Daemon binary path'),
html_print_input_text('netflow_daemon', $config['netflow_daemon'], false, 50, 200, true)
);
$table->data[3][0] = '<b>'.__('Nfdump binary path').'</b>'; $table->data[1][] = html_print_label_input_block(
$table->data[3][1] = html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true); __('Nfdump binary path'),
html_print_input_text('netflow_nfdump', $config['netflow_nfdump'], false, 50, 200, true)
);
$table->data[4][0] = '<b>'.__('Nfexpire binary path').'</b>'; $table->data[2][] = html_print_label_input_block(
$table->data[4][1] = html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true); __('Nfexpire binary path'),
html_print_input_text('netflow_nfexpire', $config['netflow_nfexpire'], false, 50, 200, true)
);
$table->data[5][0] = '<b>'.__('Maximum chart resolution').'</b>'; $table->data[2][] = html_print_label_input_block(
$table->data[5][1] = html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true); __('Maximum chart resolution'),
html_print_input_text('netflow_max_resolution', $config['netflow_max_resolution'], false, 50, 200, true)
);
$table->data[6][0] = '<b>'.__('Disable custom live view filters').'</b>'; $table->data[3][] = html_print_label_input_block(
$table->data[6][1] = html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true); __('Disable custom live view filters'),
$table->data[7][0] = '<b>'.__('Netflow max lifetime').'</b>'; html_print_checkbox_switch('netflow_disable_custom_lvfilters', 1, $config['netflow_disable_custom_lvfilters'], true)
$table->data[7][1] = html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true); );
$table->data[3][] = html_print_label_input_block(
__('Netflow max lifetime'),
html_print_input_text('netflow_max_lifetime', $config['netflow_max_lifetime'], false, 50, 200, true)
);
$table->data[8][0] = '<b>'.__('Name resolution for IP address').'</b>';
$onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;"; $onclick = "if (!confirm('".__('Warning').'. '.__('IP address resolution can take a lot of time')."')) return false;";
$table->data[8][1] = html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true); $table->data[4][] = html_print_label_input_block(
__('Name resolution for IP address'),
echo '<form id="netflow_setup" method="post">'; html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true)
);
echo '<form class="max_floating_element_size" id="netflow_setup" method="post">';
html_print_table($table); html_print_table($table);
html_print_input_hidden('update_config', 1);
// Update button. html_print_action_buttons(
echo '<div class="action-buttons w100p">'; html_print_submit_button(
html_print_input_hidden('update_config', 1); __('Update'),
html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"'); 'upd_button',
echo '</div></form>'; false,
['icon' => 'update'],
true
)
);
echo '</form>';

View File

@ -65,7 +65,7 @@ require_once 'include/functions_themes.php';
require_once 'include/functions_gis.php'; require_once 'include/functions_gis.php';
$row = 0; $row = 0;
echo '<form id="form_setup" method="post">'; echo '<form id="form_setup" class="max_floating_element_size" method="post">';
html_print_input_hidden('update_config', 1); html_print_input_hidden('update_config', 1);
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control'])); $performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
@ -392,7 +392,7 @@ $table_styles->data[$row][] = html_print_label_input_block(
$config['login_background'], $config['login_background'],
'', '',
__('Default'), __('Default'),
'', 'background_pandora_console_keys.jpg',
true, true,
false, false,
true, true,
@ -532,7 +532,7 @@ if (enterprise_installed() === true) {
$config['custom_splash_login'], $config['custom_splash_login'],
'', '',
__('Default'), __('Default'),
'default', 'default.svg',
true, true,
false, false,
true, true,
@ -648,7 +648,7 @@ if (enterprise_installed() === true) {
$config['custom_network_center_logo'], $config['custom_network_center_logo'],
'', '',
__('Default'), __('Default'),
'', 'bola_pandora_network_maps.png',
true, true,
false, false,
true, true,
@ -1588,44 +1588,84 @@ $switchProminentTime .= html_print_radio_button(
true true
); );
if ($config['csv_divider'] !== ';' && $config['csv_divider'] !== ',' && $config['csv_divider'] !== '|') { $csvDividerIconEdit = 'images/edit.svg';
$csvDividerInputs = html_print_input_text( $csvDividerIconFile = 'images/logs@svg.svg';
'csv_divider',
$config['csv_divider'], $isCommonDivider = (in_array($config['csv_divider'], $common_dividers) === true);
'', $csvDividerIcon = ($isCommonDivider === false) ? $csvDividerIconEdit : $csvDividerIconFile;
20,
255, $csvDividerInputsSub = html_print_div(
true [
); 'class' => ($isCommonDivider === false) ? 'invisible' : '',
$csvDividerInputs .= '<a id="csv_divider_custom" onclick="javascript: edit_csv_divider();">'.html_print_image( 'id' => 'custom_divider_input',
'images/logs@svg.svg', 'content' => html_print_input_text(
true, 'csv_divider',
[ $config['csv_divider'],
'id' => 'select', '',
'class' => 'main_menu_icon invert_filter', 20,
] 255,
).'</a>'; true,
} else { false,
$csvDividerInputs = html_print_select( false,
$common_dividers, '',
'csv_divider', '',
$config['csv_divider'], '',
'', 'off',
'', false,
'', '',
true, '',
false, '',
false ($isCommonDivider === false)
); ),
$csvDividerInputs .= '<a id="csv_divider_custom" onclick="javascript: edit_csv_divider();">'.html_print_image( ],
'images/edit.svg', true
true, );
[
'id' => 'pencil', $csvDividerInputsSub .= html_print_div(
'class' => 'main_menu_icon invert_filter', [
] 'class' => ($isCommonDivider === true) ? 'invisible' : '',
).'</a>'; 'id' => 'common_divider_input',
} 'content' => html_print_select(
$common_dividers,
'csv_divider',
$config['csv_divider'],
'',
'',
'',
true,
false,
false,
'',
($isCommonDivider === true),
),
],
true
);
$csvDividerInputs = html_print_div(
[
'class' => 'mrgn_right_10px',
'content' => $csvDividerInputsSub,
],
true
);
$csvDividerInputs .= html_print_image(
$csvDividerIcon,
true,
[
'id' => 'select_csv_divider',
'class' => 'invert_filter',
]
);
$csvDividerBlock = html_print_div(
[
'class' => 'flex-row-center',
'content' => $csvDividerInputs,
],
true
);
$options_data_multiplier = []; $options_data_multiplier = [];
$options_data_multiplier[0] = __('Use 1024 when module unit are bytes'); $options_data_multiplier[0] = __('Use 1024 when module unit are bytes');
@ -1980,7 +2020,7 @@ $row++;
$table_other->data[$row][] = html_print_label_input_block( $table_other->data[$row][] = html_print_label_input_block(
__('CSV divider'), __('CSV divider'),
$csvDividerInputs $csvDividerBlock
); );
$table_other->data[$row][] = html_print_label_input_block( $table_other->data[$row][] = html_print_label_input_block(
@ -2001,47 +2041,47 @@ $row++;
* *
*/ */
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Behaviour configuration').' '.ui_print_help_icon('behavoir_conf_tab', true).'</legend>'; echo '<legend>'.__('Behaviour configuration').' '.ui_print_help_icon('behavoir_conf_tab', true).'</legend>';
html_print_table($table_behaviour); html_print_table($table_behaviour);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('GIS configuration').' '.ui_print_help_icon('gis_conf_tab', true).'</legend>'; echo '<legend>'.__('GIS configuration').' '.ui_print_help_icon('gis_conf_tab', true).'</legend>';
html_print_table($table_gis); html_print_table($table_gis);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Style configuration').' '.ui_print_help_icon('style_conf_tab', true).'</legend>'; echo '<legend>'.__('Style configuration').' '.ui_print_help_icon('style_conf_tab', true).'</legend>';
html_print_table($table_styles); html_print_table($table_styles);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Charts configuration').' '.ui_print_help_icon('charts_conf_tab', true).'</legend>'; echo '<legend>'.__('Charts configuration').' '.ui_print_help_icon('charts_conf_tab', true).'</legend>';
html_print_table($table_chars); html_print_table($table_chars);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Font and Text configuration').' '.ui_print_help_icon('front_and_text_conf_tab', true).'</legend>'; echo '<legend>'.__('Font and Text configuration').' '.ui_print_help_icon('front_and_text_conf_tab', true).'</legend>';
html_print_table($table_font); html_print_table($table_font);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Visual consoles configuration').' '.ui_print_help_icon('visual_consoles_conf_tab', true).'</legend>'; echo '<legend>'.__('Visual consoles configuration').' '.ui_print_help_icon('visual_consoles_conf_tab', true).'</legend>';
html_print_table($table_vc); html_print_table($table_vc);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Reports configuration ').ui_print_help_icon('reports_configuration_tab', true).'</legend>'; echo '<legend>'.__('Reports configuration ').ui_print_help_icon('reports_configuration_tab', true).'</legend>';
html_print_table($table_report); html_print_table($table_report);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Services configuration').' '.ui_print_help_icon('services_conf_tab', true).'</legend>'; echo '<legend>'.__('Services configuration').' '.ui_print_help_icon('services_conf_tab', true).'</legend>';
html_print_table($table_ser); html_print_table($table_ser);
echo '</fieldset>'; echo '</fieldset>';
echo '<fieldset class="max_floating_element_size">'; echo '<fieldset class="margin-bottom-10">';
echo '<legend>'.__('Other configuration').' '.ui_print_help_icon('other_conf_tab', true).'</legend>'; echo '<legend>'.__('Other configuration').' '.ui_print_help_icon('other_conf_tab', true).'</legend>';
html_print_table($table_other); html_print_table($table_other);
echo '</fieldset>'; echo '</fieldset>';
@ -2068,26 +2108,21 @@ ui_require_javascript_file('pandora');
?> ?>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
function edit_csv_divider () { $(document).ready(function(){
if ($("#csv_divider_custom img").attr("id") == "pencil") { var editIcon = "<?php echo $csvDividerIconEdit; ?>";
$("#csv_divider_custom img").attr("src", "images/default_list.png"); var listIcon = "<?php echo $csvDividerIconFile; ?>";
$("#csv_divider_custom img").attr("id", "select");
var value = $("#csv_divider").val(); $("#select_csv_divider").click(function(){
$("#csv_divider").replaceWith("<input id='text-csv_divider' name='csv_divider' type='text'>"); $("#custom_divider_input").toggleClass('invisible');
$("#text-csv_divider").val(value); $("#common_divider_input").toggleClass('invisible');
} let iconPath = $("#select_csv_divider").attr("src");
else { if (iconPath.includes(editIcon)) {
$("#csv_divider_custom img").attr("src", "images/edit.svg"); $("#select_csv_divider").attr("src", listIcon);
$("#csv_divider_custom img").attr("id", "pencil"); } else {
$("#text-csv_divider").replaceWith("<select id='csv_divider' name='csv_divider'>"); $("#select_csv_divider").attr("src", editIcon);
var o = new Option(";", ";"); }
var o1 = new Option(",", ","); })
var o2 = new Option("|", "|"); })
$("#csv_divider").append(o);
$("#csv_divider").append(o1);
$("#csv_divider").append(o2);
}
}
// Juanma (07/05/2014) New feature: Custom front page for reports // Juanma (07/05/2014) New feature: Custom front page for reports
function display_custom_report_front (show,table) { function display_custom_report_front (show,table) {
@ -2213,17 +2248,15 @@ $(document).ready (function () {
$("input[name='custom_value']").val(""); $("input[name='custom_value']").val("");
$("input[name='custom_text']").val(""); $("input[name='custom_text']").val("");
$('#submit-update_button').trigger('click'); $('#button-update_button').trigger('click');
}); });
$("#button-custom_value_add_btn").click( function() { $("#button-custom_value_add_btn").click( function() {
$('#hidden-custom_value_add').val(1); $('#hidden-custom_value_add').val(1);
$('#button-update_button').trigger('click');
$('#submit-update_button').trigger('click');
}); });
//------------------------------------------------------------------ //------------------------------------------------------------------
//------------------------------------------------------------------ //------------------------------------------------------------------
// CUSTOM INTERVAL VALUES // CUSTOM INTERVAL VALUES
//------------------------------------------------------------------ //------------------------------------------------------------------
@ -2234,10 +2267,11 @@ $(document).ready (function () {
}); });
$("#button-interval_add_btn").click( function() { $("#button-interval_add_btn").click( function() {
$('#hidden-interval_values').val(1);
$('#button-update_button').trigger('click'); $('#button-update_button').trigger('click');
}); });
//------------------------------------------------------------------ //------------------------------------------------------------------
//------------------------------------------------------------------ //------------------------------------------------------------------
// CUSTOM MODULE UNITS // CUSTOM MODULE UNITS
//------------------------------------------------------------------ //------------------------------------------------------------------

View File

@ -4816,7 +4816,7 @@ function graph_nodata_image($options)
$height = $options['height']; $height = $options['height'];
} }
$width_style = ''; $width_style = 'width: 200px';
if (isset($options['width']) === true if (isset($options['width']) === true
&& empty($options['width']) === false && empty($options['width']) === false
) { ) {
@ -4835,7 +4835,7 @@ function graph_nodata_image($options)
true, true,
[ [
'title' => __('No data'), 'title' => __('No data'),
'style' => 'height:'.$height.'px;'.$width_style, 'style' => $width_style,
] ]
); );
} }

View File

@ -1,9 +1,10 @@
#form_setup { #form_setup {
display: flex; /*display: flex;
flex-direction: row; flex-direction: row;
justify-items: baseline; justify-items: baseline;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
*/
} }
fieldset { fieldset {