#9624 fixed conflics

This commit is contained in:
Daniel Cebrian 2023-03-21 10:30:35 +01:00
parent 9dea38f440
commit 563e9e15c4
3 changed files with 63 additions and 34 deletions

View File

@ -293,7 +293,7 @@ switch ($section) {
case 'sflow': case 'sflow':
$buttons['sflow']['active'] = true; $buttons['sflow']['active'] = true;
$subpage = ' &raquo '.__('Sflow'); $subpage = __('Sflow');
$help_header = 'setup_flow_tab'; $help_header = 'setup_flow_tab';
break; break;

View File

@ -45,7 +45,6 @@ $table->data[0][] = html_print_label_input_block(
__('Data storage path'), __('Data storage path'),
html_print_input_text('netflow_name_dir', $config['netflow_name_dir'], false, 50, 200, true) html_print_input_text('netflow_name_dir', $config['netflow_name_dir'], false, 50, 200, true)
); );
$table->data[0][] = '<script>$("input[name=netflow_name_dir]").on("input", function() {$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));});</script>';
$table->data[0][] = html_print_label_input_block( $table->data[0][] = html_print_label_input_block(
__('Daemon interval'), __('Daemon interval'),
@ -101,3 +100,9 @@ html_print_action_buttons(
) )
); );
echo '</form>'; echo '</form>';
?>
<script>
$("input[name=netflow_name_dir]").on("input", function() {
$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));
});
</script>

View File

@ -1,6 +1,6 @@
<?php <?php
/** /**
* Setup view for Netflow * Setup view for sflow
* *
* @category Setup * @category Setup
* @package Pandora FMS * @package Pandora FMS
@ -37,48 +37,72 @@ $update = (bool) get_parameter('update');
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->border = 0; $table->class = 'databox filter-table-adv';
$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('sflow_name_dir', $config['sflow_name_dir'], false, 50, 200, true); __('Data storage path'),
$table->data[0][1] .= '<script>$("input[name=sflow_name_dir]").on("input", function() {$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));});</script>'; html_print_input_text('sflow_name_dir', $config['sflow_name_dir'], false, 50, 200, true)
);
$table->data[0][] = html_print_label_input_block(
__('Daemon interval'),
html_print_input_text('sflow_interval', $config['sflow_interval'], false, 50, 200, true)
);
$table->data[1][0] = '<b>'.__('Daemon interval').'</b>'; $table->data[1][] = html_print_label_input_block(
$table->data[1][1] = html_print_input_text('sflow_interval', $config['sflow_interval'], false, 50, 200, true); __('Daemon binary path'),
html_print_input_text('sflow_daemon', $config['sflow_daemon'], 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('sflow_daemon', $config['sflow_daemon'], false, 50, 200, true); __('Nfdump binary path'),
html_print_input_text('sflow_nfdump', $config['sflow_nfdump'], false, 50, 200, true)
);
$table->data[3][0] = '<b>'.__('Nfdump binary path').'</b>'; $table->data[2][] = html_print_label_input_block(
$table->data[3][1] = html_print_input_text('sflow_nfdump', $config['sflow_nfdump'], false, 50, 200, true); __('Nfexpire binary path'),
html_print_input_text('sflow_nfexpire', $config['sflow_nfexpire'], 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('sflow_nfexpire', $config['sflow_nfexpire'], false, 50, 200, true); __('Maximum chart resolution'),
html_print_input_text('sflow_max_resolution', $config['sflow_max_resolution'], false, 50, 200, true)
);
$table->data[5][0] = '<b>'.__('Maximum chart resolution').'</b>'; $table->data[3][] = html_print_label_input_block(
$table->data[5][1] = html_print_input_text('sflow_max_resolution', $config['sflow_max_resolution'], false, 50, 200, true); __('Disable custom live view filters'),
html_print_checkbox_switch('sflow_disable_custom_lvfilters', 1, $config['sflow_disable_custom_lvfilters'], 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('sflow_disable_custom_lvfilters', 1, $config['sflow_disable_custom_lvfilters'], true); __('Sflow max lifetime'),
$table->data[7][0] = '<b>'.__('Max. sflow lifetime').'</b>'; html_print_input_text('sflow_max_lifetime', $config['sflow_max_lifetime'], false, 50, 200, true)
$table->data[7][1] = html_print_input_text('sflow_max_lifetime', $config['sflow_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('sflow_get_ip_hostname', 1, $config['sflow_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('sflow_get_ip_hostname', 1, $config['sflow_get_ip_hostname'], false, $onclick, '', true)
);
echo '<form class="max_floating_element_size" id="sflow_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>';
?>
<script>
$("input[name=sflow_name_dir]").on("input", function() {
$(this).val($(this).val().replace(/[^a-z0-9]/gi, ""));
});
</script>